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

.diff return incorrect value when comparing 1st of Feb #5822

Open
jckh1234 opened this issue Feb 1, 2021 · 0 comments
Open

.diff return incorrect value when comparing 1st of Feb #5822

jckh1234 opened this issue Feb 1, 2021 · 0 comments

Comments

@jckh1234
Copy link

jckh1234 commented Feb 1, 2021

Describe the bug
When using .diff()

To Reproduce
Go to http://jsfiddle.net/n4fodzr0/
console.log(new moment("2021-02-01").diff("1960-01-31", "years", true))
//output: 60.998587570621474
console.log(new moment("2021-01-31").diff("1960-01-31", "years", true))
//output: 61

Expected behavior
Expected the first line of code a value larger than 61

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • Browser Chrome
  • Version 2.21

Moment-specific environment
"Mon Feb 01 2021 23:17:23 GMT+0800 (China Standard Time)"
"2/1/2021, 11:17:23 PM"
-480
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.104 Safari/537.36"
"2.2.1"



Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant