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

isBefore return unexpected result #1476

Closed
aNyMoRe0505 opened this issue Apr 29, 2021 · 1 comment
Closed

isBefore return unexpected result #1476

aNyMoRe0505 opened this issue Apr 29, 2021 · 1 comment

Comments

@aNyMoRe0505
Copy link

Describe the bug
截圖 2021-04-29 下午4 02 59

check the above img, I think nowStringInput.isBefore(now) should return false, same as now.isBefore(nowStringInput)

Idk if this is a bug or not.. if I replace new Date() with new Date('2021-04-29'), the result will be expected

截圖 2021-04-29 下午4 10 12

Expected behavior
I think nowStringInput.isBefore(now) should return false

Information

  • Day.js Version v1.10.4
  • Browser 90.0.4430.85
  • Time zone: GMT +8
@aNyMoRe0505
Copy link
Author

the root cause is millisecond, you can check the img

截圖 2021-04-29 下午4 29 02

so I close this issue

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