1
0
Fork 0
mirror of synced 2024-09-29 08:41:16 +13:00

Fix calendar using locale aware start of week

This commit is contained in:
Andrew Kingston 2024-05-02 15:19:31 +01:00
parent 72725ce49b
commit 667760eda8

View file

@ -4,6 +4,9 @@
import dayjs from "dayjs"
import NumberInput from "./NumberInput.svelte"
import { createEventDispatcher } from "svelte"
import isoWeek from "dayjs/plugin/isoWeek"
dayjs.extend(isoWeek)
export let value
@ -43,7 +46,7 @@
return []
}
let monthEnd = monthStart.endOf("month")
let calendarStart = monthStart.startOf("week")
let calendarStart = monthStart.startOf("isoWeek")
const numWeeks = Math.ceil((monthEnd.diff(calendarStart, "day") + 1) / 7)
let mondays = []