add support for opening hours that automatically change over time
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { isToday, isAfter, parse } from "date-fns";
|
||||
import { isToday, isAfter, parse, compareAsc } from "date-fns";
|
||||
import { nb } from "date-fns/locale";
|
||||
import { toZonedTime, format } from "date-fns-tz";
|
||||
|
||||
@@ -47,3 +47,7 @@ export function isTodayOrFuture(
|
||||
const zonedDate = toLocalTime(date);
|
||||
return isToday(zonedDate) || isAfter(zonedDate, zonedNow);
|
||||
}
|
||||
|
||||
export function compareDates(a: Date | string, b: Date | string) {
|
||||
return compareAsc(new Date(a), new Date(b));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user