MCPcopy Create free account
hub / github.com/dailydotdev/apps / getExpiresAt

Function getExpiresAt

packages/shared/src/features/feedExplain/duration.ts:35–41  ·  view source on GitHub ↗
(
  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.
35export 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. */
44export const formatUntil = (expiresAt: string, now = Date.now()): string => {

Callers 2

toControlFunction · 0.90
toStoredFunction · 0.90

Calls 1

nowMethod · 0.80

Tested by

no test coverage detected