MCPcopy Create free account
hub / github.com/ZenNotes/zennotes / localeFirstDay

Function localeFirstDay

packages/app-core/src/lib/week-start.ts:8–20  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

6 * available.
7 */
8export function localeFirstDay(): number {
9 try {
10 const loc = new Intl.Locale(navigator.language) as unknown as {
11 weekInfo?: { firstDay?: number }
12 getWeekInfo?: () => { firstDay?: number }
13 }
14 const info = loc.weekInfo ?? loc.getWeekInfo?.()
15 if (info && typeof info.firstDay === 'number') return info.firstDay % 7 // 7(Sun)->0
16 } catch {
17 /* ignore */
18 }
19 return 1
20}
21
22/**
23 * Resolve the `calendarWeekStart` preference to a 0 (Sunday) .. 6 index for

Callers 2

week-start.test.tsFile · 0.90
resolveWeekStartDayFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected