react-datetime icon indicating copy to clipboard operation
react-datetime copied to clipboard

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

Open Macy6 opened this issue 2 years ago • 11 comments

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

Macy6 avatar Jan 04 '23 18:01 Macy6

When we will release this one?

tinhtony2506 avatar Feb 01 '23 07:02 tinhtony2506

@arqex Please focus this issue

tinhtony2506 avatar Feb 01 '23 07:02 tinhtony2506

👍 would love to see this resolved as well

baileygranam avatar Feb 03 '23 03:02 baileygranam

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 avatar Feb 07 '23 12:02 AndrewDaneSpackman

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

AndrewDaneSpackman avatar Feb 08 '23 09:02 AndrewDaneSpackman

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

suraj975 avatar Feb 11 '23 07:02 suraj975

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 avatar Mar 17 '23 14:03 AndrewDaneSpackman

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

AndrewDaneSpackman avatar Mar 17 '23 14:03 AndrewDaneSpackman

@arqex Any updates on this?

deep-121 avatar Nov 02 '23 07:11 deep-121

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

lukezavrel avatar Feb 14 '24 15:02 lukezavrel

I fork the repository and fix this issue. Try https://www.npmjs.com/package/@iftek/react-datetime

yuan9090 avatar Jul 30 '24 10:07 yuan9090