MCPcopy Create free account
hub / github.com/ether/etherpad / inWindow

Function inWindow

src/node/updater/MaintenanceWindow.ts:70–76  ·  view source on GitHub ↗
(now: Date, window: MaintenanceWindow)

Source from the content-addressed store, hash-verified

68 * tz. Cross-midnight windows wrap at 24:00 — see file header for the exact set.
69 */
70export const inWindow = (now: Date, window: MaintenanceWindow): boolean => {
71 const s = toMinutes(window.start);
72 const e = toMinutes(window.end);
73 if (s == null || e == null || s === e) return false;
74 const m = wallMinutes(now, window.tz);
75 return s < e ? (m >= s && m < e) : (m >= s || m < e);
76};
77
78const buildAt = (year: number, month: number, day: number, mins: number,
79 tz: MaintenanceWindow['tz']): Date => {

Callers 3

decideScheduleFunction · 0.90
decideTriggerApplyFunction · 0.90

Calls 2

toMinutesFunction · 0.85
wallMinutesFunction · 0.85

Tested by

no test coverage detected