(ms: number)
| 8 | import { isAppOverlayOpen } from '../lib/overlay-open' |
| 9 | |
| 10 | function 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 | |
| 21 | function cssEscape(value: string): string { |
| 22 | if (typeof CSS !== 'undefined' && typeof CSS.escape === 'function') return CSS.escape(value) |