? ? Pending

User tests: Successful: Unsuccessful:

avatar roland-d
roland-d
26 Sep 2018

Summary of Changes

The current implementation of the calendar field does not allow for customizing the date format. This change gives the user control over how to display the dates. In The Netherlands we require a date in the format of day - month - year, which is now nearly impossible to achieve.

I have kept the current default values as-is so we stick to B/C.

Testing Instructions

  1. Go to Users -> Fields
  2. Click on Fields
  3. Click on New
  4. Enter the Title Birthdate
  5. Click on Save & Close
  6. Click on Users
  7. Edit a user
  8. Click on the tab Fields
  9. Select a date from the calendar
  10. The date will be in the format of Year - Month - Day
  11. Being Dutch, I want the date in Day - Month - Year
  12. Click on Save and Close
  13. Apply the patch
  14. Click on Fields
  15. Edit the Birthdate field
  16. Enter the Format %d-%m-%Y
  17. Click on Save and Close
  18. Click on Users
  19. Edit a user
  20. Click on the tab Fields
  21. Select a date from the calendar
  22. The date will be in the format of Day - Month - Year
  23. Success

Expected result

That I can set the format of the date.

Actual result

I cannot set the date of the format.

Documentation Changes Required

Yes, here: https://docs.joomla.org/J3.x:Adding_custom_fields/Calendar_Field

@brianteeman Can you please check the language strings.

avatar roland-d roland-d - open - 26 Sep 2018
avatar roland-d roland-d - change - 26 Sep 2018
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 26 Sep 2018
Category Administration Language & Strings Front End Plugins
avatar roland-d roland-d - change - 26 Sep 2018
Labels Added: ? ?
avatar brianteeman
brianteeman - comment - 26 Sep 2018

@roland-d golden rule - if you have to write such a long essay to explain a field then there is something wrong

avatar roland-d
roland-d - comment - 26 Sep 2018

@brianteeman I actually copied it from the documentation to be complete.

avatar brianteeman
brianteeman - comment - 26 Sep 2018

Documentation belongs in documentation not in the ui

Be explicit wherever necessary but don't explain the obvious. On the web scanning is the norm and too much text weakens the effectiveness of the message - it does not enhance it.

avatar roland-d roland-d - change - 26 Sep 2018
The description was changed
avatar roland-d roland-d - edited - 26 Sep 2018
avatar roland-d
roland-d - comment - 26 Sep 2018

@brianteeman Thanks for the feedback, language file updated accordingly.

avatar brianteeman
brianteeman - comment - 26 Sep 2018

I have tested this item ? unsuccessfully on c1a57f5

The date format changed in the admin but when it was displayed in the front end it was still in the native format


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/22373.

avatar brianteeman brianteeman - test_item - 26 Sep 2018 - Tested unsuccessfully
avatar brianteeman
brianteeman - comment - 26 Sep 2018

For me it is confusing that this field now uses two different date formats and syntax

The default date field uses YYYY-MM-DD format
The new field uses php %y-%m-%d format

avatar roland-d
roland-d - comment - 26 Sep 2018

I fixed all your findings.

As for the different formats, if we are going the route of using YYYY-MM-DD we should develop our own flavor of date formats to match the PHP format. This is the wrong direction if you ask me.

If we do change the YYYY-MM-DD to the PHP format, we have a B/C break. All I can think of is that we add the PHP format to this field as well.

I have no idea why this field is different from other date fields in Joomla.

avatar brianteeman
brianteeman - comment - 26 Sep 2018

I believe we use the YYYY-MM-DD format here and in lots of other places because thats the mysql date format

avatar infograf768
infograf768 - comment - 26 Sep 2018

@Bakual
can you have look if this is compatible with calendar translate

avatar Bakual
Bakual - comment - 26 Sep 2018

Actually, this shouldn't be needed at all, and we deliberately decided against adding a custom format parameter when we created the field.
The calendar should use the language strings to display the date. If it shows the wrong format, then likely the dutch language has an issue, not the custom field.
Check what values these strings have in your language pack:

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"

I'm not sure anymore why there is a reference to DATE_FORMAT_LC5 and DATE_FORMAT_LC4 in the code. It shouldn't be needed at all since the translateFormat feature ignores that format anyway.

avatar Bakual
Bakual - comment - 27 Sep 2018

Checking the nl_NL language pack, the date format is indeed wrong in there. Not only for the new ones, but also for the old DATE_FORMAT_LC4 - 6 ones.
@roland-d Can you try if the calendar field works when you change those values in the dutch language pack or create a language override for those strings?

avatar Quy Quy - change - 2 Oct 2018
Status Pending Information Required
avatar roland-d
roland-d - comment - 3 Oct 2018

@Bakual I had some time to test and I agree that the date formats are wrong in the Dutch language file. Let's put that aside. So I created a language override of the DATE_FORMAT_LC4 and set it to d-m-Y for both frontend and backend. In the custom field I have set not to show time. When I edit an article that has the calendar field set. The selected date shows up as Y-m-d. That sounds wrong to me.

avatar Bakual
Bakual - comment - 3 Oct 2018

The LC4 one isn't relevant for the calendar. The fours ones I posted in #22373 (comment) are the ones that have to fit.

avatar kukubayo
kukubayo - comment - 16 Nov 2018

I have tested this item successfully on 602ca08


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/22373.

avatar kukubayo kukubayo - test_item - 16 Nov 2018 - Tested successfully
avatar kofaysi
kofaysi - comment - 18 Jan 2019

I tested that the current J3.9.2 calendar string is formatted according the language strings. I like to keep date formats consistent. I don't see to use exceptions in a list of dates or else.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/22373.

avatar kofaysi
kofaysi - comment - 18 Jan 2019

I tested that the current J3.9.2 calendar string is formatted according the language strings. I like to keep date formats consistent. I don't see to use exceptions in a list of dates or else.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/22373.

avatar Bakual
Bakual - comment - 18 Jan 2019

@roland-d Can we close this? Becasue as I've written above it was a bug in the language files and this PR shouldn't be needed at all.

avatar roland-d
roland-d - comment - 23 Jan 2019

@Bakual I am going to give this another test and close if needed.

avatar roland-d
roland-d - comment - 27 Jan 2019

Closing this as a non-issue. Seems to be fine with the updated language file.

avatar roland-d roland-d - change - 27 Jan 2019
Status Information Required Closed
Closed_Date 0000-00-00 00:00:00 2019-01-27 20:05:32
Closed_By roland-d
avatar roland-d roland-d - close - 27 Jan 2019

Add a Comment

Login with GitHub to post a comment