ui: show the "day being celebrated" label
Deploy / deploy (push) Successful in 38s

Adds a real label under each hour's heading — "Monday in the 10th week
after Trinity", "The 1st Sunday of Advent" — computed from whichever
LiturgicalDay the hour actually resolved against, which can differ from
the nav date for Compline's evening anticipation.

calendar/day-label.ts combines two things: an ordinal week-within-season
label (pure date arithmetic on the season anchors from calendar/temporal.ts
and calendar/easter.ts — Trinity-counted, not Divinum Officium's own
Pentecost-counted convention; meant to become configurable later via the
same day->id indirection already used for the sanctoral calendar, not
hardcoded forever), and a feast name from calendar/commemorations.ts's
occurrence decision — shown alone if the feast displaces the day outright,
prefixed onto the temporal label if merely commemorated, or omitted
entirely if nothing's occurring.
This commit is contained in:
2026-08-10 07:07:10 -04:00
parent eaaca05ad8
commit 226fff2ce6
8 changed files with 243 additions and 3 deletions
+2 -1
View File
@@ -1,6 +1,7 @@
import type { HourDefinition, HourPart, ResolvedOrdo, ResolvedPart } from './types';
import type { LiturgicalDay } from '../calendar/types';
import { resolveEveningDay } from '../calendar/vespers';
import { getDayLabel } from '../calendar/day-label';
import { getPsalmVerses } from '../psalter';
import { getCommonProper } from '../propers';
import { getHymnDoxologyId } from './hymn-doxology';
@@ -97,5 +98,5 @@ export function resolveOrdo(date: string): ResolvedOrdo {
// need to keep a separate "real" day around.
const day = resolveEveningDay(date);
const parts = complineDefinition.parts.flatMap((part) => resolvePart(part, day));
return { hourId: 'compline', date, parts };
return { hourId: 'compline', date, parts, dayLabel: getDayLabel(day) };
}
+2 -1
View File
@@ -1,6 +1,7 @@
import type { HourDefinition, HourPart, ResolvedOrdo, ResolvedPart } from './types';
import type { LiturgicalDay, Weekday } from '../calendar/types';
import { resolveDay, isSundayOrFeast } from '../calendar';
import { getDayLabel } from '../calendar/day-label';
import { getPsalmsFor } from '../psalter/distribution';
import { getPsalmVerses } from '../psalter';
import { getMartyrologyEntryFor } from '../martyrology';
@@ -117,5 +118,5 @@ function resolvePart(part: HourPart, date: string, day: LiturgicalDay): Resolved
export function resolveOrdo(date: string): ResolvedOrdo {
const day = resolveDay(date);
const parts = primeDefinition.parts.flatMap((part) => resolvePart(part, date, day));
return { hourId: 'prime', date, parts };
return { hourId: 'prime', date, parts, dayLabel: getDayLabel(day) };
}
+8
View File
@@ -135,4 +135,12 @@ export interface ResolvedOrdo {
parts: ResolvedPart[];
/** Set when this hour hasn't been built yet — UI shows "coming soon" instead of empty content. */
notImplemented?: true;
/**
* "Monday in the 10th week after Trinity", "St. Ereden — ...", etc. —
* see calendar/day-label.ts. Computed from whichever LiturgicalDay the
* hour actually resolved against, which can differ from `date` itself
* (Compline may anticipate tomorrow — see calendar/vespers.ts). Absent
* on not-yet-built hours.
*/
dayLabel?: string;
}