Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix goToDate off-by-one bug #97

Closed
wants to merge 1 commit into from
Closed

Conversation

pdpino
Copy link
Collaborator

@pdpino pdpino commented May 15, 2021

Fixes #93

  • This bug occured when numberOfDays===1 only
  • In goToDate(), when the dates are compared (i.e. moment.diff), the difference may be slightly less than 1 day (e.g. 23h 59min), and gets truncated down to 0 days --> it moves one day less than what it should move.
  • Now, the dates are moved to the start of the day (startOf('day')) to be compared properly, and avoid truncation

@pdpino pdpino mentioned this pull request May 16, 2021
@pdpino
Copy link
Collaborator Author

pdpino commented May 16, 2021

Already merged in #99, closing

@pdpino pdpino closed this May 16, 2021
@pdpino pdpino deleted the bug/go-to-date branch May 22, 2021 21:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

goToDate not working properly
1 participant