-
Couldn't load subscription status.
- Fork 767
Closed
Description
Describe the bug
I get a negative number for a diff although the end date is after the start date.
To Reproduce
const start = DateTime.fromISO("2022-05-05T23:00", { zone: "UTC" });
const end = DateTime.fromISO("2022-05-10T00:00", { zone: "Europe/Madrid" }); // 2022-05-09T22:00Z
const diff = end.diff(start, ['days', 'hours', 'minutes']).toObject();
// diff === { days: 4, hours: -1, minutes: 0 }Actual vs Expected behavior
I expect the diff to equal { days: 3, hours: 23, minutes: 0} instead of { days: 4, hours: -1, minutes: 0 }. It seems unintuitive to me that I have to think about adding and then subtracting to get to the diff.
Desktop (please complete the following information):
- OS: Mac OS
- Browser Chrome 99
- Luxon version 2.3.1
- Your timezone "America/New_York"
ab-pm and MonstraG
Metadata
Metadata
Assignees
Labels
No labels