DateTime pickers value should always has "T" between date and time #2996
trymeouteh
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The value format for a regular input:datetime-local tag is "YYYY-MM-DDTHH:MM" (2015-11-22T21:30), and not "YYYY-MM-DD HH:MM" (2015-11-22 21:30).
flatpickr for date and time pickers will always display the value by default in this format "YYYY-MM-DD HH:MM" (2015-11-22 21:30) and also set the value to this format which is against HTML standards.
I would like to suggest that all date time pickers do what is done when using the altInput and altFormat settings, which is it will hide the input tag and store the normal formatted value (In this case it will store "YYYY-MM-DDTHH:MM" (2015-11-22T21:30) this value in this format) and the newly created input tag this is visible that is designed to show the formatted value will displayed the date time formatted without the "T" (In this case it will store "YYYY-MM-DD HH:MM" (2015-11-22 21:30) this value in this format).
This way when submitting date time values to the server, it will not need to parse the date time to see if there is a "T" in it or not, there will always be a "T" and can parse the date time from there. This is an issue when users have JavaScript disabled which then all date time values submitted will have a "T" in them,
Beta Was this translation helpful? Give feedback.
All reactions