RFC: No textbox, formatting, timezone #2341
Closed
Eonasdan
started this conversation in
Request for comment
Replies: 3 comments
-
I think this would work great for cases like #550 and #381 in which both ask for a different way to handle the selected date |
Beta Was this translation helpful? Give feedback.
0 replies
-
yes @William-H-M those kinds of tickets are just what I had in mind |
Beta Was this translation helpful? Give feedback.
0 replies
-
I think I'm going to remove tz and formatting support. Dayjs is already up to requiring 3 plugins just to do some of the stuff the picker was doing with moment. I'm going to try to use the native apis |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am thinking about making the picker unaware of any kind of input field. In current version you had to set a textbox to target:
I think I could drop ideas like
userCurrent
and the picker being aware of where you as a developer want the resulting date/time to go.Instead you would do something like this (none of this is done, just pseudo code):
This would allow the developer more control over formatting or where the result goes at the cost of requiring a bit more setup.
Edit:
I'm now also considering dropping formatting and direct timezone support.
TZ:
Moment and dayjs requires extra plugins for timezone to work and if the picker no longer has to be aware of a text field then it seems like it shouldn't need to care about timezones either. The developer can retrieve the date from the picker as the example above and format or convert the timezone as needed. I'm not 100% on this part as I don't know if there would be any ramifications from storing selected dates with the locale tz.
Formatting/locale:
Formatting between dayjs and momentjs is slightly different. Moment provides a locale bundle or individual locales and from what I can tell dayjs only provides them as individual plugins.
I'd likely have to provide additional option properties for displaying month names and weekday labels. The picker currently uses the supplied format string to determine what components to display. e.g.
hh:mm
would not display the date picker or seconds.Dropping the last two will be somewhat annoying for a developer using the picker I'd imagine. However it will make the picker lighter. I think it'd be possible to just use native js date apis if I didn't need to use tz/formatting.
Beta Was this translation helpful? Give feedback.
All reactions