react-datetime
react-datetime copied to clipboard
Fixed 'selecting the 31st day of previous month' bug
Description
Fixed 'selecting the 31st of previous month' bug
Motivation and Context
-
Why do you think this pull request should be merged?
- This pull request fixes the aforementioned bug.
-
Does it solve a problem, in that case what problem?
- Yes, it resolves a bug related to selecting the 31st day of a previous month giving the 1st day of that month on the datetimepicker.
-
If these changes fixes an open issue, please provide a link to the issue here
- https://github.com/arqex/react-datetime/issues/844
- https://github.com/arqex/react-datetime/issues/804
- https://github.com/arqex/react-datetime/issues/744
Checklist
[ ] I have not included any built dist files (us maintainers do that prior to a new release)
[ ] I have added tests covering my changes
[ ] All new and existing tests pass
[ ] My changes required the documentation to be updated
[ ] I have updated the documentation accordingly
[ ] I have updated the TypeScript 1.8 type definitions accordingly
[ ] I have updated the TypeScript 2.0+ type definitions accordingly
When we will release this one?
@arqex Please focus this issue
👍 would love to see this resolved as well
I would love to see this change merged in and updated. This has been an issue for quite some time, and I would like to see it finally get resolved.
@arqex @Macy6 Is there an ETA on this fix being pushed? It is causing some serious issues with our date selection!
Until the code is not merged, @AndrewDaneSpackman you can use renderDay function to handle this situation.
https://codesandbox.io/s/trusting-allen-xpfthw?file=/src/App.js
Until the code is not merged, @AndrewDaneSpackman you can use renderDay function to handle this situation.
https://codesandbox.io/s/trusting-allen-xpfthw?file=/src/App.js
I have attempted to implement this fix and, while the displayed value is now correct, the value set in state is not; it is the previous value. As such, this is not useable as a solution for me.
@arqex Any updates on this? Apart from this issue, this component does everything else we need it to. Maybe even forgoing the rendering of previous/next months days instead, so they cannot be selected?
@arqex Any updates on this?
Until the code is not merged, @AndrewDaneSpackman you can use renderDay function to handle this situation. https://codesandbox.io/s/trusting-allen-xpfthw?file=/src/App.js
I have attempted to implement this fix and, while the displayed value is now correct, the value set in state is not; it is the previous value. As such, this is not useable as a solution for me.
I have rewritten this workaround to fit my needs, so it might help you as well. It should set the value correctly and preserve time https://codesandbox.io/p/sandbox/trusting-hertz-lddqcs?file=%2Fsrc%2FApp.js
I fork the repository and fix this issue. Try https://www.npmjs.com/package/@iftek/react-datetime