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

Function formatDate

packages/app-core/src/lib/database-cells.ts:26–31  ·  view source on GitHub ↗
(iso: string)

Source from the content-addressed store, hash-verified

24const genId = defaultGenId
25
26export function formatDate(iso: string): string {
27 if (!iso) return ''
28 const d = new Date(`${iso}T00:00:00`)
29 if (Number.isNaN(d.getTime())) return iso
30 return d.toLocaleDateString(undefined, { month: 'short', day: 'numeric', year: 'numeric' })
31}
32
33export function optionLabel(field: DbField, value: string): string {
34 const opt = field.options?.find((o) => o.value === value)

Callers 2

DatabaseBoardViewFunction · 0.90
CellFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected