-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Format ignored for datetime widget when date and time format specified #7250
Comments
I'm having this issues as well. Since I'm setting up Decap for the first time I'm not sure if this was a new bug or just incorrectly documented. It doesn't seem that any of formatting properties work according to the documentation:
When I remove all 3 properties the default format is not the correct time (e.g. 2006-01-02T15:04:05.000Z). The Decap default has the "Z" literal purporting to be UTC but the hours were not converted from my local time (-07:00). I would recommend using: |
I'm seeing the same behavior. Does the UI reflect your I have all three values set up in NetlifyCMS (Euro-style UI, ISO-like storage), where they seem to coexist without issue. Did I get lucky, or is this a regression? Unfortunate that this widget seems so difficult to get right, as quite a bit of (re)work seems to have gone into it already by the developers. |
@EthanLMartin you are correct, the documentation states exactly the opposite of the actual behavior. the truth is: if date_format or time_format are set, format is ignored. We have to change either the docs or the implementation. I am leaning towards changing the implementation. Does anybody have any other proposals on how to approach this? |
Describe the bug
When using the date time widget, if the date_format or time_format options are used, then the format option is ignored.
The documentation specifies that "If set, date_format and time_format are not used."
To Reproduce
format
,date_format
andtime_format
options (e.g.YYYY-MM-DDTHH:mm:ss
,DD/MM/YYYY
andHH:mm
respectively){date_format}T{time_format}
(e.g.DD/MM/YYYYTHH:mm
based on the above)Expected behavior
As per the documentation, expected the saved format so be the overall format specified. (In the examples above this would be
YYYY-MM-DDTHH:mm:ss
)Screenshots
N/A
Applicable Versions:
CMS configuration
Additional context
N/A
The text was updated successfully, but these errors were encountered: