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

Function localeName

packages/app-core/src/lib/template-render.ts:40–46  ·  view source on GitHub ↗
(
  date: Date,
  field: 'month' | 'weekday',
  width: 'long' | 'short'
)

Source from the content-addressed store, hash-verified

38// "lundi 9 juin"). Numeric tokens stay locale-neutral, and the daily-note title
39// itself remains ISO `YYYY-MM-DD` for file-friendly sorting and searching.
40function localeName(
41 date: Date,
42 field: 'month' | 'weekday',
43 width: 'long' | 'short'
44): string {
45 return date.toLocaleDateString(undefined, { [field]: width })
46}
47
48function pad2(n: number): string {
49 return String(n).padStart(2, '0')

Callers 1

formatDateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected