Skip to content

Commit

Permalink
Merge pull request #13599 from Budibase/fix/calendary-start-of-week
Browse files Browse the repository at this point in the history
Fix calendar using locale aware start of week
  • Loading branch information
aptkingston committed May 2, 2024
2 parents 72725ce + 667760e commit 3d4f9b8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/bbui/src/Form/Core/DatePicker/Calendar.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 = []
Expand Down

0 comments on commit 3d4f9b8

Please sign in to comment.