6.0.0-alpha10
5/14/25

Search Results: 8 of 16 [ <<First <Prev Next> Last>> ] [ Return to Search Results ]


[#14749] SmartList due date parser doesn't always honor abbreviated date format preference
Summary SmartList due date parser doesn't always honor abbreviated date format preference
Queue Nag
Queue Version 4.2.1
Type Bug
State Feedback
Priority 2. Medium
Owners
Requester leonardo (at) cefetmg (dot) br
Created 12/06/2017 (2716 days ago)
Due
Updated 01/24/2018 (2667 days ago)
Assigned 01/22/2018 (2669 days ago)
Resolved
Milestone
Patch No

History
01/24/2018 02:10:42 PM leonardo (at) cefetmg (dot) br Comment #3 Reply to this comment
Without looking at the code, but are you sure that the mini format 
is used here, and not the general date format preference?
I don't really know. I may even misunderstood your consideration, but 
I think that "due date" fields do validate dates using flexible rules, 
allowing users to use not only dates (in some format I can't say) but 
words like "today" and "tomorrow" too.

A little description is shown below the fields: "E.g., Is due within 2 
days of today"

Anyway, notice that even if the mini date format preference is not 
being used here, the behavior is not consistent, which may confuse 
users.

Regards,
Leonardo Lopes
01/22/2018 04:41:22 PM Jan Schneider Comment #2
State ⇒ Feedback
Reply to this comment
Without looking at the code, but are you sure that the mini format is 
used here, and not the general date format preference?
12/06/2017 05:17:28 PM leonardo (at) cefetmg (dot) br Comment #1
Priority ⇒ 2. Medium
Patch ⇒ No
Milestone ⇒
Queue ⇒ Nag
Summary ⇒ SmartList due date parser doesn't always honor abbreviated date format preference
Type ⇒ Bug
State ⇒ Unconfirmed
Reply to this comment
Hi everyone.

When creating a new SmartList in Nag, the due date is not parsed 
correctly or at least in a consistent way. My locale is 
"America/Sao_Paulo" and the abbreviated date format preference is 
"d-m-Y" ($_prefs['date_format_mini']['value'] = '%d/%m/%Y';)

The thing seems very messy: if the user set the due date as 
"01/12/17", the date is parsed as:
Horde_Date Object (
     [_year:protected] => 2017
     [_month:protected] => 1
     [_mday:protected] => 12
     [_hour:protected] => 12
     [_min:protected] => 0
     [_sec:protected] => 0
     [_timezone:protected] => America/Sao_Paulo
     [_defaultFormat:protected] => Y-m-d H:i:s
     [_formatCache:protected] => Array()
)
This isn't correct if you consider the "date_format_mini" preference.

Now, when trying to set the due date as "13/12/17", the date is parsed as:
Horde_Date Object
(
     [_year:protected] => 2017
     [_month:protected] => 12
     [_mday:protected] => 13
     [_hour:protected] => 12
     [_min:protected] => 0
     [_sec:protected] => 0
     [_timezone:protected] => America/Sao_Paulo
     [_defaultFormat:protected] => Y-m-d H:i:s
     [_formatCache:protected] => Array()
)

which is now correct according to the "date_format_mini" preference.

How can I explain to my users that if the day of month is smaller than 
12 they should set date as "Y-m-d", but if it is not they should use 
'Y-m-d'? Even to me it doesn't make any sense.

I will be glad to provide any additional information in order to solve this.

Thanks in advance.

Saved Queries