-
-
Notifications
You must be signed in to change notification settings - Fork 2
Closed
Labels
Milestone
Description
Context
Vuetify uses Math.floor for most of the calculations, so it is not symmetrical either.
Other adapters:
- moment: symmetrical
- date-fns: symmetrical
- luxon: correct for hours, but non-symmetrical for weeks
Problem
- when calculating diffs by weeks
- the result is not symmetrical because of
Math.floor
- the result is not symmetrical because of
- when calculating diffs by hours, minutes and seconds
- the result is not symmetrical because of
Math.round - it returns
-0instead of0(JS quirk we should rather hide)
- the result is not symmetrical because of
Suggestion
- always return based on
largestUnit
It would align with current implementation in Vuetify (for positive range) while fixing the values in negative range gaining the symmetry.
AndreyYolkin