Fix Vespers status wrongly saying "Second Vespers" when a Sunday anticipates it
Deploy / deploy (push) Successful in 1m29s

getVespersStatusLabel detected First-Vespers anticipation only via
winner.vespersFrom, a tag only ever set for a sanctoral tomorrow-winner
(tagVespersFrom). When Vespers anticipates a Sunday that wins its own
day outright (a temporal winner, e.g. 2026-08-29 anticipating 2026-08-30
since the Decollation of St. John Baptist is below the duplex-2-classis
floor that would let it keep its own evening), the tag never gets set
and the status wrongly read "Second Vespers (of today)" even though the
whole page was showing tomorrow's identity.

Comparing the resolved day's date against the originally-requested date
detects anticipation uniformly regardless of winner kind, so this drops
the vespersFrom dependency entirely.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ME8QNPdEmHSbSx1r6VmDRG
This commit is contained in:
2026-08-30 06:10:52 -04:00
parent 95901ef56a
commit 5ae1f3a3e0
4 changed files with 63 additions and 6 deletions
+10 -4
View File
@@ -500,11 +500,17 @@ const TEMPORAL_CATEGORY_RANK_LABELS: Record<TemporalCategory, Bi> = {
* silent about *why* a given identity governs tonight (a reader has to
* already know, e.g., that St. Zephyrinus falls on tomorrow's date to
* realize this evening is anticipating him). Pass the result of
* `calendar/vespers.ts`'s `resolveEveningDay`, not a plain `resolveDay`
* only that carries the `vespersFrom` tag this reads.
* `calendar/vespers.ts`'s `resolveEveningDay`, not a plain `resolveDay`,
* plus the originally-requested date — comparing the two directly (rather
* than checking `winner.vespersFrom`, which only ever gets set for a
* *sanctoral* tomorrow-winner, see `vespers.ts`'s `tagVespersFrom`) is
* what makes this correct even when tomorrow's winner is `temporal` (e.g.
* an ordinary Sunday winning outright over a merely-commemorated Simplex
* saint) — a case `winner.vespersFrom` can never detect since that field
* doesn't exist on the temporal variant of `DayWinner` at all.
*/
export function getVespersStatusLabel(day: LiturgicalDay): Bi {
if (day.winner.kind === 'sanctoral' && day.winner.vespersFrom === 'firstVespersOfTomorrow') {
export function getVespersStatusLabel(day: LiturgicalDay, requestedDate: string): Bi {
if (day.date !== requestedDate) {
return bi('First Vespers (of tomorrow)', 'Vesperæ de sequenti');
}
return bi('Second Vespers (of today)', 'Vesperæ de hodierno');