arqex / react-datetime

A lightweight but complete datetime picker react component.
1.99k stars 872 forks source link

Fixed 'selecting the 31st day of previous month' bug #848

Open Macy6 opened 1 year ago

Macy6 commented 1 year ago

Description

Fixed 'selecting the 31st of previous month' bug

Motivation and Context

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
tinhtony2506 commented 1 year ago

When we will release this one?

tinhtony2506 commented 1 year ago

@arqex Please focus this issue

baileygranam commented 1 year ago

👍 would love to see this resolved as well

AndrewDaneSpackman commented 1 year ago

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.

AndrewDaneSpackman commented 1 year ago

@arqex @Macy6 Is there an ETA on this fix being pushed? It is causing some serious issues with our date selection!

suraj975 commented 1 year ago

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

AndrewDaneSpackman commented 1 year ago

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.

AndrewDaneSpackman commented 1 year ago

@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?

deep-121 commented 8 months ago

@arqex Any updates on this?

lukezavrel commented 4 months ago

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