Function
getExpiresAt
(
duration: FeedControlDuration | undefined,
now = Date.now(),
)
Source from the content-addressed store, hash-verified
| 33 | |
| 34 | // The API sets the real one; this is for the change shown before it answers. |
| 35 | export const getExpiresAt = ( |
| 36 | duration: FeedControlDuration | undefined, |
| 37 | now = Date.now(), |
| 38 | ): string | null => |
| 39 | duration |
| 40 | ? new Date(now + durationDays[duration] * dayMs).toISOString() |
| 41 | : null; |
| 42 | |
| 43 | /** "until Sun", or "until Thu, Oct 22" when the weekday alone is ambiguous. */ |
| 44 | export const formatUntil = (expiresAt: string, now = Date.now()): string => { |
Tested by
no test coverage detected