Skip to main content

Module window

Module window 

Source
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§

AdminWindow
One day’s hours, as written in the configuration: day, start, end (“tuesday”, “09:00”, “17:00”); older files say minutes instead of end.

Constants§

NAMES 🔒
SHORT 🔒

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 date with 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 windows have any hours on date’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_ranges reads 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”.