You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, if I use const daysDiff = end.date() - start.date(); then I get the expected result. Expected behavior
See above (expect daysDiff to be 1)
-> 1 day 1 hr
Information
Day.js Version 1.8.16
OS: Mac OS Mojave Version 10.14.2
Browser: Chrome Version 77.0.3865.90
Time zone: GMT-07:00 DST (Pacific Daylight Time)
The text was updated successfully, but these errors were encountered:
If you add true as the third argument, you will get the diff result in float.
In this way, it's easy to find out that the actuall diff in only '0.04' day (1 hour) , so the result 0 is expected. (Math.round(0.04) // 0)
Describe the bug
I'm using
.diff()
with two dayjs objects to calculate a duration. However, this doesn't seem to work withday
. Example:However, if I use
const daysDiff = end.date() - start.date();
then I get the expected result.Expected behavior
See above (expect
daysDiff
to be 1)-> 1 day 1 hr
Information
The text was updated successfully, but these errors were encountered: