(date: Date)
| 21 | const NO_COLLAPSE = { today: false, upcoming: false, waiting: false, done: false } |
| 22 | |
| 23 | function greetingFor(date: Date): string { |
| 24 | const h = date.getHours() |
| 25 | if (h < 12) return 'Good morning' |
| 26 | if (h < 18) return 'Good afternoon' |
| 27 | return 'Good evening' |
| 28 | } |
| 29 | |
| 30 | /** Compact "edited 3h ago" style stamp; falls back to a short date past a week. */ |
| 31 | function timeAgo(ts: number, now: number): string { |