Issue #852 Issue while selecting previous month date from FEBRUARY#854
Open
ManishManda wants to merge 2 commits intoarqex:masterfrom
Open
Issue #852 Issue while selecting previous month date from FEBRUARY#854ManishManda wants to merge 2 commits intoarqex:masterfrom
ManishManda wants to merge 2 commits intoarqex:masterfrom
Conversation
|
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 #852
Checklist