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

Function localeDatePart

packages/app-core/src/lib/vault-layout.ts:187–197  ·  view source on GitHub ↗
(
  date: Date,
  locale: string,
  options: Intl.DateTimeFormatOptions
)

Source from the content-addressed store, hash-verified

185}
186
187function localeDatePart(
188 date: Date,
189 locale: string,
190 options: Intl.DateTimeFormatOptions
191): string {
192 try {
193 return date.toLocaleDateString(localeArg(locale), options)
194 } catch {
195 return date.toLocaleDateString(undefined, options)
196 }
197}
198
199function escapeRegex(value: string): string {
200 return value.replace(/[\\^$.*+?()[\]{}|]/g, '\\$&')

Callers 1

formatDateNotePatternFunction · 0.85

Calls 1

localeArgFunction · 0.85

Tested by

no test coverage detected