datetime/quiet_hours_utils library
"Quiet hours" helper — roadmap #613.
Tests whether an instant falls inside a configured daily mute window (e.g.
22:00–07:00 "do not disturb") and, when it does, reports when quiet ends — so
a notification can be deferred to quietUntil instead of firing during the
blackout. Windows are minute-of-day and may wrap past midnight (start > end),
which is the common overnight case.
This is the time-of-day blackout primitive; it is intentionally simpler than
BusinessHours (#595), which models a per-weekday OPEN schedule. Quiet
windows here apply every day.
Classes
- QuietHours
- A set of daily quiet windows with point-in-time and "when does quiet end" queries. Immutable.
- QuietWindow
-
A daily quiet window in minutes past midnight. When startMinute <
endMinute it is a same-day window
[start, end); when startMinute > endMinute it WRAPS past midnight (e.g.1320→420is 22:00–07:00). The two bounds must differ (a zero-length window mutes nothing; a full-day mute has no well-defined end).