(now: Date, window: MaintenanceWindow)
| 68 | * tz. Cross-midnight windows wrap at 24:00 — see file header for the exact set. |
| 69 | */ |
| 70 | export 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 | |
| 78 | const buildAt = (year: number, month: number, day: number, mins: number, |
| 79 | tz: MaintenanceWindow['tz']): Date => { |
no test coverage detected