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

Function formatDate

packages/app-core/src/components/QuickNotesView.tsx:10–19  ·  view source on GitHub ↗
(ms: number)

Source from the content-addressed store, hash-verified

8import { isAppOverlayOpen } from '../lib/overlay-open'
9
10function formatDate(ms: number): string {
11 const d = new Date(ms)
12 const now = new Date()
13 const sameYear = d.getFullYear() === now.getFullYear()
14 return d.toLocaleDateString(undefined, {
15 month: 'short',
16 day: 'numeric',
17 year: sameYear ? undefined : 'numeric'
18 })
19}
20
21function cssEscape(value: string): string {
22 if (typeof CSS !== 'undefined' && typeof CSS.escape === 'function') return CSS.escape(value)

Callers 1

QuickNotesViewFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected