Closed sc0ttkclark closed 1 year ago
Core includes a jQuery date picker, it handles date + time, but it doesn't have a time-only option. We could use HTML5 time field for that, but I'm not sure if that is enough here or not.
Oops, clarification, jQuery UI Datepicker only does dates, it does not include date+time or time.
No jQuery UI stylesheet included with WP Core currently -- https://core.trac.wordpress.org/ticket/18909
If we add jQuery UI Datepicker, then nothing will look right, so we have to nixx this (for now).
An alternative option: We could reuse the same date and/or time picker that the Post editor screen uses for publish date.
Maybe I'm not familiar with wordpress standards for 3rd party libraries, but why not using something like this: http://mugifly.github.io/jquery-simple-datetimepicker/
Any inclusion of a third party time picker should be done separately from the Fields API, for purposes of evaluating whether or not a specific script is the correct forward-facing choice, is accessible, and meets all criteria for inclusion in core. Only at that point could we move forward with inclusion of one within the Fields API for our purposes. Otherwise, including any script would require time which may not be guaranteed that it would be accepted into core at such a point in time that Fields API is evaluated for merging.
Why don't use the jquery ui datepicker that is available within wordpress? See it in https://developer.wordpress.org/reference/functions/wp_register_script/
However, a date, datetime control will be useful, in case the browsers doesn't support it, the text field will be used right? May be a pattern prefilled?
Yes, the jQuery UI datepicker is included with WordPress core, but the styles aren't (yet). If they were, that'd take care of date
controls, but would still leave datetime
and time
controls up in the air since Datepicker only does dates.
Hi Skott. here this date and time picker is very smart. Matts from facetwp use it. So have a look very fast and very good looking. https://github.com/chmln/flatpickr
There is even the https://github.com/xdan/datetimepicker but flatpickr look very nice.
A fusion of flatpickr and https://github.com/stuttter/wp-datepicker-styling would be great :)
Including new Date/time pickers in core as part of the initial Fields API proposal is likely to hold us up in a major way. Our best bet is to move forward with a simple version (jQuery date only) or exclude this type of field entirely.
Once Fields API is in core, we can make separate proposals for enhanced control types with scripts like these.
Should we include a date, datetime, and/or time control type?