DatePicker incorrect time value
See original GitHub issueEnvironment
Tech | Version |
---|---|
@material-ui/pickers | 3.2.5 |
material-ui | 4.3.3 |
React | 16.8.6 |
Browser | any |
Peer library | “@date-io/date-fns”: “^1.3.11” |
Steps to reproduce
- Use any
DatePicker
component, listendate
prop inonChange
callback - Click any date on UI.
Expected behavior
I except selected date with midnight time, like this: Tue Sep 10 2019 00:00:00 GMT+0300 (GMT+03:00)
Actual behavior
Now onChange
cb passing date like this: Tue Sep 10 2019 10:02:00 GMT+0300 (GMT+03:00)
with current time.
Gif example
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Getting a RangeError: Invalid Time Value when using React ...
I have set up a DatePicker component using the react-datepicker library and am passing it an initial date value calculated using today's ...
Read more >throw out RangeError('Invalid time value') · Issue #1752 - GitHub
Expected behavior Hello, I want to use the component to select date, but it keeps throwing out Invalid time value error. No idea...
Read more >Module Builder: Datepicker shows incorrect time when setting ...
Setting a DateTime field value shows a different time when editing the item in the backend.
Read more >RangeError: Invalid time value in JavaScript | bobbyhadz
The "Uncaught RangeError: Invalid time value" error occurs when calling a method on an invalid date, e.g. new Date('asdf').toISOString() . To solve the...
Read more >DateTimePicker incorrect parsing when user types in date
Since provided format includes the time format and the entered value does not contain the same (input element value will only contain date ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thank you, problem solved. 😃 As i see, i missed
initialFocusedDate
prop in docs.Then it will use
new Date()
as a basic You can passinitialFocusedDate={startOfDay(newDate)}