Fix calendar using locale aware start of week
This commit is contained in:
parent
72725ce49b
commit
667760eda8
|
@ -4,6 +4,9 @@
|
||||||
import dayjs from "dayjs"
|
import dayjs from "dayjs"
|
||||||
import NumberInput from "./NumberInput.svelte"
|
import NumberInput from "./NumberInput.svelte"
|
||||||
import { createEventDispatcher } from "svelte"
|
import { createEventDispatcher } from "svelte"
|
||||||
|
import isoWeek from "dayjs/plugin/isoWeek"
|
||||||
|
|
||||||
|
dayjs.extend(isoWeek)
|
||||||
|
|
||||||
export let value
|
export let value
|
||||||
|
|
||||||
|
@ -43,7 +46,7 @@
|
||||||
return []
|
return []
|
||||||
}
|
}
|
||||||
let monthEnd = monthStart.endOf("month")
|
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)
|
const numWeeks = Math.ceil((monthEnd.diff(calendarStart, "day") + 1) / 7)
|
||||||
|
|
||||||
let mondays = []
|
let mondays = []
|
||||||
|
|
Loading…
Reference in New Issue