Example
const date1 = luxon.DateTime.fromISO("2020-09-06T12:00");
const date2 = luxon.DateTime.fromISO("2019-06-10T14:00");
const diff = Interval.fromDateTimes(later, now);
const diffHours = diff.length('hours');
if (diffHours > 1) {
// ...
}
Documentation for Luxon v2.x
In the Luxon documentation they mention durations and intervals.
It seems that you would be best off using Intervals and then calling the .length('hours')
on the Interval if you're interested to know if something has been over an hour.
Durations
The Duration class represents a quantity of time such as "2 hours and 7 minutes".
const dur = Duration.fromObject({ hours: 2, minutes: 7 });
dur.hours; //=> 2
dur.minutes; //=> 7
dur.seconds; //=> 0
dur.as('seconds'); //=> 7620
dur.toObject(); //=> { hours: 2, minutes: 7 }
dur.toISO(); //=> 'PT2H7M'
Intervals
Intervals are a specific period of time, such as "between now and midnight". They're really a wrapper for two DateTimes that form its endpoints.
const now = DateTime.now();
const later = DateTime.local(2020, 10, 12);
const i = Interval.fromDateTimes(now, later);
i.length() //=> 97098768468
i.length('years') //=> 3.0762420239726027
i.contains(DateTime.local(2019)) //=> true
i.toISO() //=> '2017-09-14T04:07:11.532-04:00/2020-10-12T00:00:00.000-04:00'
i.toString() //=> '[2017-09-14T04:07:11.532-04:00 – 2020-10-12T00:00:00.000-04:00)