-
-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
onChange always returns string #66
Comments
You can get hour from Date(), but you can't get Date() from hour alone. Hence the string returned. |
Could it work like in https://material-ui-pickers.dev/ ? There if you pass date to the time picker as value, in onChange you get another date instance where date is same like in the value you provided while time is set based on the values selected in the time picker. |
In my project I created a wrapper component where I handle formatting and parsing so now my wrapped timepicker can handle Date, timestamp and string. However I needed to add format prop to the component for cases when value is null since then you can't infer which format is needed based on the passed value. |
Interesting idea, but not something I'll be looking to implement in the immediate future. |
This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this issue will be closed in 14 days. |
Since value can be Date or string would it make sense that onChange returns value in whichever format value was using?
So if I pass date, I get the date back and if I pass string I get the string back.
The text was updated successfully, but these errors were encountered: