Open ManishManda opened 1 year ago
Any reason this PR can't be merged? This is a pretty significant bug in the component.
Actually I see the repo here hasn't been maintained in more than a year! 😳
Has anyone created a fork with this fix merged in?
I fork the repository and fix this issue. Try https://www.npmjs.com/package/@iftek/react-datetime
if we select previous month date from current month, unexpected date is being displayed
Description
According to moment documentation : if you chain multiple actions to construct a date, you should start from a year, then a month, then a day etc. Otherwise you may get unexpected results, like when day=31 and current month has only 30 days (the same applies to native JavaScript Date manipulation), the returned date will be the 30th of the current month (see month for more details).
link for reference: https://momentjs.com/docs/#/get-set/date/
i just changed the order of setting moment object date on update of a date by user
Motivation and Context
this change fixes the open issue https://github.com/arqex/react-datetime/issues/852
Checklist