(stamp?: string | null)
| 22 | // once-per-day guard idiom shared by the quest offers popup and the reading |
| 23 | // reminder hero. A missing or unparseable stamp counts as not seen. |
| 24 | export const isTodayStamp = (stamp?: string | null): boolean => { |
| 25 | if (!stamp) { |
| 26 | return false; |
| 27 | } |
| 28 | |
| 29 | const parsed = new Date(stamp); |
| 30 | |
| 31 | return isValidDate(parsed) && isToday(parsed); |
| 32 | }; |
| 33 | |
| 34 | export const publishTimeRelativeShort = ( |
| 35 | value: Date | number | string, |
no test coverage detected