Function
localeName
(
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. |
| 40 | function localeName( |
| 41 | date: Date, |
| 42 | field: 'month' | 'weekday', |
| 43 | width: 'long' | 'short' |
| 44 | ): string { |
| 45 | return date.toLocaleDateString(undefined, { [field]: width }) |
| 46 | } |
| 47 | |
| 48 | function pad2(n: number): string { |
| 49 | return String(n).padStart(2, '0') |
Tested by
no test coverage detected