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

Function formatDate

packages/app-core/src/components/ArchiveView.tsx:15–24  ·  view source on GitHub ↗
(ms: number)

Source from the content-addressed store, hash-verified

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

Callers 1

ArchiveViewFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected