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

Function getNightKey

packages/shared/src/features/patchy/patchyTriggers.ts:36–39  ·  view source on GitHub ↗
(now: Date, window: PatchyHourWindow)

Source from the content-addressed store, hash-verified

34// The night a late read belongs to, so the yawn plays once per night even
35// when the window wraps past midnight.
36export const getNightKey = (now: Date, window: PatchyHourWindow): string => {
37 const day = getWindowStartDay(now, window) ?? now;
38 return `${day.getFullYear()}-${day.getMonth() + 1}-${day.getDate()}`;
39};
40
41const FRIDAY = 5;
42

Callers 2

usePatchyCompanionFunction · 0.90

Calls 1

getWindowStartDayFunction · 0.85

Tested by

no test coverage detected