Open arseniybanayev opened 11 months ago
Luxon is not designed to work with units smaller than a millisecond or fractional milliseconds. Ideally, this should be enforced and always yield invalid datetimes. There is no support for sub-millisecond accuracy in the underlying platform (JavaScript) anyways. Ideally this should also be stated in the docs clearly, if it isn't in there already.
See also #909, which I honestly forgot about.
Describe the bug Fractional milliseconds are dropped by
plus
andminus
.To Reproduce
Actual vs Expected behavior Expected the second assertion to pass because I added a fractional amount of milliseconds at the end of the second line, but the fourth line dropped the fractional milliseconds. If fractional milliseconds are unsupported, then
plus({ milliseconds: .999 })
should throw an exception or (worse) drop the fractional milliseconds from the return value to be consistent with the laterminus({ days: 1})
.