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,6 +1,7 @@
import { differenceInCalendarDays } from "date-fns"
import { useIntl } from "react-intl"
import { dt } from "@/lib/dt"
import Button from "@/components/TempDesignSystem/Button"
import Body from "@/components/TempDesignSystem/Text/Body"
import Caption from "@/components/TempDesignSystem/Text/Caption"
@@ -41,7 +42,7 @@ export default function RateSummary({
const checkInDate = new Date(roomsAvailability.checkInDate)
const checkOutDate = new Date(roomsAvailability.checkOutDate)
const nights = differenceInCalendarDays(checkOutDate, checkInDate)
const nights = dt(checkOutDate).diff(dt(checkInDate), "days")
return (
<div className={styles.summary}>