You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the DatePicker implements a Window that can't be controlled at all (besides exposing a ref, style and shadow).
Ideally, the component should be refactored and split into:
A calendar: a generic implementation that takes props such as month: number, year: number, selectedDate: string, selectedDateStart: string, selectedDateEnd: string. The name could be CalendarView.
An input that displays the calendar: following the Select component and the <input type=date> HTML element, a dropdown that shows a masked text input and a button that opens the calendar.
Because Date contains time information, manipulating it can cause the date to shift because of daylight savings times around the world, therefore I suggest falling back to what input=date uses, a date string that is then parsed according to the date strings format.
Optionally:
A date picker window: using the CalendarView above, the DatePicker could be renamed to DateDialog, and some additional properties should be added to allow icon, title and close button configuration.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Currently, the DatePicker implements a
Window
that can't be controlled at all (besides exposing a ref, style and shadow).Ideally, the component should be refactored and split into:
month: number
,year: number
,selectedDate: string
,selectedDateStart: string
,selectedDateEnd: string
. The name could beCalendarView
.Select
component and the<input type=date>
HTML element, a dropdown that shows a masked text input and a button that opens the calendar.Because
Date
contains time information, manipulating it can cause the date to shift because of daylight savings times around the world, therefore I suggest falling back to what input=date uses, a date string that is then parsed according to the date strings format.Optionally:
CalendarView
above, theDatePicker
could be renamed toDateDialog
, and some additional properties should be added to allow icon, title and close button configuration.Beta Was this translation helpful? Give feedback.
All reactions