?
avatar mojazz
mojazz
26 May 2017

Steps to reproduce the issue

Create language string override of DATE_FORMAT_CALENDAR_DATETIME = %m-%d-%Y %H:%M:%S
Open an existing article for editing
Save the article

Expected result

Article saves without error

Actual result

These warnings are displayed:

Invalid field: Created Date
Invalid field: Modified Date
Invalid field: Start Publishing

System information (as much as possible)

Joomla! 3.7.2
PHP 7.1

Additional comments

I am desperately trying to find COMPLETE and understandable documentation on the operation of the new calendar field, picker and translating the datetime format.

I have a custom component I would like to use a calendar field in but CANNOT because it must be m/d/Y and I can not get Joomla to save a record to the database if the format is anything but the standard non-user-friendly format.

It would be great if someone had a clue what was happening here. Thanks

avatar mojazz mojazz - open - 26 May 2017
avatar joomla-cms-bot joomla-cms-bot - labeled - 26 May 2017
avatar Bakual
Bakual - comment - 26 May 2017

Create language string override of DATE_FORMAT_CALENDAR_DATETIME = %m-%d-%Y %H:%M:%S

The following four language strings are important for the translate feature of the calendar formfield:

DATE_FORMAT_CALENDAR_DATE="%Y-%m-%d"
DATE_FORMAT_CALENDAR_DATETIME="%Y-%m-%d %H:%M:%S"
DATE_FORMAT_FILTER_DATE="Y-m-d"
DATE_FORMAT_FILTER_DATETIME="Y-m-d H:i:s"

The first two are how the calendar displays the format, with or without time respectively (showtime true or false in the XML)
The second two are how the dates are expected to be sent, again with or without the time. The validation of the field is done using this format.
Please note the difference in the format syntax. The first is using strftime notation (JS needs to understand it) and the latter date notation. That's why we need both and they need to comply eachother.

So your issue is solved if you also create an override: DATE_FORMAT_FILTER_DATETIME="Y-m-d H:i:s"

If you want to help improve the doc, feel free to edit https://docs.joomla.org/Calendar_form_field_type. It's a wiki.

Closing as not a core issue.

avatar Bakual Bakual - change - 26 May 2017
Status New Closed
Closed_Date 0000-00-00 00:00:00 2017-05-26 07:22:47
Closed_By Bakual
avatar Bakual Bakual - close - 26 May 2017

Add a Comment

Login with GitHub to post a comment