Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Issue #852 Issue while selecting previous month date from FEBRUARY#854

Open
ManishManda wants to merge 2 commits into
arqex:master from
ManishManda:issue-#852
Open

Issue #852 Issue while selecting previous month date from FEBRUARY #854
ManishManda wants to merge 2 commits into
arqex:master from
ManishManda:issue-#852

Conversation

@ManishManda

@ManishManda ManishManda commented Feb 13, 2023

Copy link
Copy Markdown

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

[ ] 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

TrekSoft commented Feb 7, 2024

Copy link
Copy Markdown

Any reason this PR can't be merged? This is a pretty significant bug in the component.

TrekSoft commented Feb 7, 2024

Copy link
Copy Markdown

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?

Copy link
Copy Markdown

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /