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 |
is used here, and not the general date format preference?
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
State ⇒ Feedback
used here, and not the general date format preference?
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
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.