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
Is your feature request related to a problem? Please describe.
React admin offers components to display/edit dates and datetimes (<DateField/>, <DateInput/>, <DateTimeInput/>), but nothing for time.
Describe the solution you'd like HTML <input type="time"> seems to be well supported across browsers, so it should be safe to create a new components to edit time like date and datetime. To display time, JS toLocaleTimeString seems also safe to use.
Describe alternatives you've considered
For the moment, I wrote my own implementations, but it would be nice to see those components by default in react-admin.
To edit times, I use the <DateTimeInput/> with the prop type="time". For the format function, I use convertDateToString but only returning the time part of the string.
Is your feature request related to a problem? Please describe.
React admin offers components to display/edit dates and datetimes (
<DateField/>
,<DateInput/>
,<DateTimeInput/>
), but nothing for time.Describe the solution you'd like
HTML
<input type="time">
seems to be well supported across browsers, so it should be safe to create a new components to edit time like date and datetime. To display time, JS toLocaleTimeString seems also safe to use.Describe alternatives you've considered
For the moment, I wrote my own implementations, but it would be nice to see those components by default in react-admin.
To edit times, I use the
<DateTimeInput/>
with the proptype="time"
. For the format function, I useconvertDateToString
but only returning the time part of the string.To display times, I use the following code:
Which is basically the same as
<DateField/>
but usingtoLocaleTimeString
instead oftoLocaleDateString
.If you want I can make PRs to add those new components.
The text was updated successfully, but these errors were encountered: