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

Function getDaysUntilWeeklyQuestReset

packages/shared/src/lib/date.ts:45–46  ·  view source on GitHub ↗
(from: Date = new Date())

Source from the content-addressed store, hash-verified

43// DEFAULT_WEEK_START and the server's UTC rotation boundary. `|| 7` keeps the
44// reset a full week out on Monday itself rather than collapsing to today.
45export const getDaysUntilWeeklyQuestReset = (from: Date = new Date()): number =>
46 (8 - from.getUTCDay()) % 7 || 7;
47
48// The instant the current weekly period ends (the next Monday at 00:00 UTC).
49export const getWeeklyQuestPeriodEnd = (from: Date = new Date()): Date => {

Callers 3

WeeklyQuestResetTimerFunction · 0.90
date.spec.tsFile · 0.90
getWeeklyQuestPeriodEndFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected