arqex / react-datetime

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

Select wrong date 31/08 v3.1.1 #844

Open tinhtony2506 opened 2 years ago

tinhtony2506 commented 2 years ago

"react-datetime": "3.1.1"

select date 2021-09-01 then set date 2021-08-31 the date input shows 2021-08-01

tinhtony2506 commented 2 years ago

https://github.com/arqex/react-datetime/issues/804

tinhtony2506 commented 2 years ago

issue persists with latest version :(

bhavinzwt commented 1 year ago

yes, this issue still persists in the latest version. Is there any solution to solve this issue?

Macy6 commented 1 year ago

The issue still persists with the latest version, any updates? :(

UP1503 commented 1 year ago

Before:

image

After:

image

I am facing the same problem so I have checked and I found an issue in _updateDate method of DateTime.js file line number 349. There is something wrong with the moment after use of moment([2022,10,31] ) format it is working fine.

I am not sure whether it helps you or not, but it's working fine for me.

Macy6 commented 1 year ago

Thanks so much for sharing your solution! Unfortunately, this is still not working for me... I'll post my fix here if I could make it work!

UP1503 commented 1 year ago

Thanks so much for sharing your solution! Unfortunately, this is still not working for me... I'll post my fix here if I could make it work!

image

Hello @Macy6 Still facing the same problem and using onChange event for date update that time also need to do change for line no. 362 which I have marked in the attached image. This is work for me.

If you have already solved this issue with better solution, please share your solution.

Macy6 commented 1 year ago

Thanks so much for sharing your solution! Unfortunately, this is still not working for me... I'll post my fix here if I could make it work!

image

Hello @Macy6 Still facing the same problem and using onChange event for date update that time also need to do change for line no. 362 which I have marked in the attached image. This is work for me.

If you have already solved this issue with better solution, please share your solution.

Hey @UP1503, can confirm that your solution works for me! I really appreciate your help!! Happy New Year xD

tinhtony2506 commented 1 year ago

@Macy6 is it working on your site ?

tinhtony2506 commented 1 year ago

@Macy6 Can confirm that your force is perfect <3

yuan9090 commented 2 months ago

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