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

Function getWeeklyQuestPeriodEnd

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

Source from the content-addressed store, hash-verified

47
48// The instant the current weekly period ends (the next Monday at 00:00 UTC).
49export const getWeeklyQuestPeriodEnd = (from: Date = new Date()): Date => {
50 const periodEnd = new Date(from);
51 periodEnd.setUTCDate(
52 periodEnd.getUTCDate() + getDaysUntilWeeklyQuestReset(from),
53 );
54 periodEnd.setUTCHours(0, 0, 0, 0);
55
56 return periodEnd;
57};
58
59export const isOlderThan = (seconds: number, date: Date) => {
60 const currentDate = getTodayTz('UTC', new Date());

Callers 2

WeeklyQuestResetTimerFunction · 0.90
date.spec.tsFile · 0.90

Calls 1

Tested by

no test coverage detected