[Tickets #14749] Re: SmartList due date parser doesn't always honor abbreviated date format preference
noreply at bugs.horde.org
noreply at bugs.horde.org
Wed Dec 6 17:20:33 UTC 2017
DO NOT REPLY TO THIS MESSAGE. THIS EMAIL ADDRESS IS NOT MONITORED.
Ticket URL: https://bugs.horde.org/ticket/14749
------------------------------------------------------------------------------
Ticket | 14749
Updated By | leonardo at cefetmg.br
Summary | SmartList due date parser doesn't always honor
| abbreviated date format preference
Queue | Nag
Version | 4.2.1
Type | Bug
State | Unconfirmed
Priority | 2. Medium
Milestone |
Patch |
Owners |
------------------------------------------------------------------------------
leonardo at cefetmg.br (2017-12-06 17:17) wrote:
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.
More information about the bugs
mailing list