bugGNU Octave - Bugs: bug #50558, datestr() automatic selection of...

 
 

bug #50558: datestr() automatic selection of output format is based on the first row of input only

Submitted by:  Lars Kindermann <larskindermann>
Submitted on:  Thu 16 Mar 2017 11:47:22 AM UTC  
 
Category: Octave FunctionSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Inaccurate Result
Status: FixedAssigned to: None
Originator Name: Open/Closed: Closed
Release: devOperating System: Any

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Sun 19 Mar 2017 05:17:41 AM UTC, comment #1:

I pushed your patch here (http://hg.savannah.gnu.org/hgweb/octave/rev/4aa13310250c). Because Octave can do automatic broadcasting, there is no need to use repmat, which saves on memory. I changed that and also added a BIST test for the new behavior.

Thanks for all the time you have spent on these date/time functions.

Rik <rik5>
Project Administrator
Thu 16 Mar 2017 11:47:22 AM UTC, original submission:

The output of

looks different from

The reason is, that automatic format selection is based on the first row only. This is, because the check is performed just once at the very first iteration of the main loop over the rows of the date vectors.

Attached is a patch that changes this behaviour by moving that code out of the loop and make it check wether the time-fields of all rows are zero or all dates are == [-1, 12, 31]

So nothing changes for a single input but the format of multiple date inputs does not depend on the order of the array any more:

Lars Kindermann <larskindermann>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #40015:  datestr.diff added by larskindermann (702B - text/x-patch - patch for datestr.m)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by larskindermann (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 19 Mar 2017 05:17:41 AM UTCrik5StatusNone=>Fixed
      Open/ClosedOpen=>Closed
    Thu 16 Mar 2017 11:47:22 AM UTClarskindermannAttached File-=>Added datestr.diff, #40015

    Back to the top


    Powered by Savane 3.1-cleanup1