Expand description
Working hours: the days and hours work can reach you, each day on or off,
from a start to an end. Mail keeps arriving in the background; the Porch
shows it only in these hours and always says when they open again; outside
them, quiet time (quiet.rs). Predictable looks, not silence: in a field
trial, people given no notifications at all felt more anxious, while
batching them three times a day helped (Fitz et al. 2019; docs/research.md).
The same rows say when offices are open, for tasks that need one.
Structs§
- Admin
Window - One day’s hours, as written in the configuration:
day,start,end(“tuesday”, “09:00”, “17:00”); older files sayminutesinstead ofend.
Constants§
Functions§
- current
- The window open right now, as (opening, closing).
- day_
index 🔒 - “mo”, “lu”, “monday”, “lundi”: a day, Monday 0.
- days_
open - The days a set of hours opens, Monday first.
- default_
office_ hours - Offices’ usual hours when the configuration says none: Monday to Friday, 9:00 to 17:00.
- hours_
on - The hours of
date, from its first opening to its last closing, when it has any. - kinds_
on - Each window of
datewith what its hours are for, as (opening, closing, kind: “work”, “admin”, “leisure”), the earliest first. - next_
opening - When the next window opens, within the coming week.
- open_
day - Whether
windowshave any hours ondate’s weekday. - parse_
ranges - Opening hours written short, as a task keeps its office’s: “mo-fr 09:00-17:00”, “mo-fr 09:00-12:00, 14:00-17:00; sa 09:00-12:00”. Days in two letters, English or French (“lu-ve”), or named; a range, or a list with commas.
- parse_
time 🔒 - “09:30” → (9, 30); “24:00” ends a day; anything past it, or not a time, is none.
- parse_
weekday 🔒 - English and French day names, full or in three letters.
- ranges_
text - Hours as
parse_rangesreads them, days with the same hours together: “mo-fr 09:00-17:00”. - spans_
on - Each window of
date, as (opening, closing), the earliest first. - tidy_
time 🔒 - “09:00”, from “9:00” or “9h00” or “9”.