feat(sw-697): changed to dt instead of differenceInCalendarDays

This commit is contained in:
Pontus Dreij
2024-11-04 16:29:09 +01:00
parent 04df824ea1
commit 6b5934e2d0
2 changed files with 6 additions and 4 deletions

View File

@@ -1,7 +1,8 @@
import { differenceInCalendarDays } from "date-fns"
import { useSearchParams } from "next/navigation"
import { useIntl } from "react-intl"
import { dt } from "@/lib/dt"
import Body from "@/components/TempDesignSystem/Text/Body"
import Caption from "@/components/TempDesignSystem/Text/Caption"
import Subtitle from "@/components/TempDesignSystem/Text/Subtitle"
@@ -35,7 +36,7 @@ export default function PriceList({
let nights = 1
if (fromDate && toDate) {
nights = differenceInCalendarDays(new Date(fromDate), new Date(toDate))
nights = dt(toDate).diff(dt(fromDate), "days")
}
const {