feat: add Price details modal

This commit is contained in:
Arvid Norlin
2024-12-04 16:40:45 +01:00
parent df1e4da001
commit 0c7c6ea21a
24 changed files with 382 additions and 60 deletions
+13 -1
View File
@@ -1,4 +1,6 @@
import { Lang } from "@/constants/languages"
import d from "dayjs"
import type { Lang } from "@/constants/languages"
/**
* Get the localized month name for a given month index and language
@@ -13,3 +15,13 @@ export function getLocalizedMonthName(monthIndex: number, lang: Lang) {
return monthName.charAt(0).toUpperCase() + monthName.slice(1)
}
export function getNights(start: string, end: string) {
const range = []
let current = d(start)
while (current.isBefore(end)) {
range.push(current)
current = current.add(1, "days")
}
return range
}