Merged in fix/SW-3078-wrong-dates-time-zones (pull request #2388)
fix(SW-3078): change to string instead of Date in Zod schema * fix(SW-3078): change to string instead of Date in Zod schema Approved-by: Michael Zetterberg Approved-by: Linus Flood
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import d from "dayjs"
|
||||
import { dt } from "@/lib/dt"
|
||||
|
||||
import type { Lang } from "@/constants/languages"
|
||||
|
||||
@@ -16,6 +16,6 @@ export function getLocalizedMonthName(monthIndex: number, lang: Lang) {
|
||||
return monthName.charAt(0).toUpperCase() + monthName.slice(1)
|
||||
}
|
||||
|
||||
export function getNumberOfNights(startDate: Date, endDate: Date) {
|
||||
return d(endDate).diff(startDate, "day")
|
||||
export function getNumberOfNights(startDate: string, endDate: string) {
|
||||
return dt(endDate).diff(startDate, "day")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user