radio: quiet hours default 00:00-08:00; banks 1-3 fill script (ISS, calling, Gouda-area repeaters); docs
All checks were successful
Deploy production / deploy (push) Successful in 1m20s
All checks were successful
Deploy production / deploy (push) Successful in 1m20s
This commit is contained in:
@@ -89,15 +89,19 @@ describe('scanner', () => {
|
||||
});
|
||||
|
||||
describe('quiet hours', () => {
|
||||
const q = parseQuiet('23:00-07:30');
|
||||
it('parses and wraps midnight (Amsterdam time)', () => {
|
||||
expect(q?.label).toBe('23:00–07:30');
|
||||
const q = parseQuiet('00:00-08:00');
|
||||
it('parses and checks Amsterdam wall time', () => {
|
||||
expect(q?.label).toBe('00:00–08:00');
|
||||
expect(parseQuiet('off')).toBeNull();
|
||||
expect(inQuiet(fromZoned(2026, 10, 27, 2, 11), q)).toBe(true);
|
||||
expect(inQuiet(fromZoned(2026, 10, 27, 7, 1), q)).toBe(true);
|
||||
expect(inQuiet(fromZoned(2026, 10, 27, 7, 30), q)).toBe(false);
|
||||
expect(inQuiet(fromZoned(2026, 10, 26, 18, 55), q)).toBe(false);
|
||||
expect(inQuiet(fromZoned(2026, 10, 26, 23, 0), q)).toBe(true);
|
||||
expect(inQuiet(fromZoned(2026, 10, 27, 8, 0), q)).toBe(false);
|
||||
expect(inQuiet(fromZoned(2026, 10, 26, 23, 59), q)).toBe(false);
|
||||
expect(inQuiet(fromZoned(2026, 10, 26, 18, 55), null)).toBe(false);
|
||||
});
|
||||
it('wraps midnight', () => {
|
||||
const w = parseQuiet('23:00-07:30');
|
||||
expect(inQuiet(fromZoned(2026, 10, 26, 23, 0), w)).toBe(true);
|
||||
expect(inQuiet(fromZoned(2026, 10, 27, 7, 30), w)).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -41,9 +41,9 @@ export const ISS_MIN_EL = 10;
|
||||
export const REMIND_MINUTES = 10;
|
||||
export const ISS_DOWNLINK_HZ = 145_800_000;
|
||||
/** No reminders are sent when the send time falls in this Amsterdam window (RADIO_QUIET_HOURS overrides). */
|
||||
export const QUIET_HOURS = '23:00-07:30';
|
||||
export const QUIET_HOURS = '00:00-08:00';
|
||||
export type Quiet = { from: number; to: number; label: string } | null;
|
||||
/** "23:00-07:30" -> minutes of day; "off" / "" -> null (no quiet hours). */
|
||||
/** "00:00-08:00" -> minutes of day; "off" / "" -> null (no quiet hours). */
|
||||
export function parseQuiet(spec: string | null | undefined): Quiet {
|
||||
const m = /^\s*(\d{1,2}):(\d{2})\s*[-–]\s*(\d{1,2}):(\d{2})\s*$/.exec(spec ?? '');
|
||||
if (!m) return null;
|
||||
|
||||
Reference in New Issue
Block a user