(ms: number)
| 13 | import { isAppOverlayOpen } from '../lib/overlay-open' |
| 14 | |
| 15 | function 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 | |
| 26 | function cssEscape(value: string): string { |
| 27 | if (typeof CSS !== 'undefined' && typeof CSS.escape === 'function') return CSS.escape(value) |