diff options
| author | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-07-28 15:07:12 +0200 |
|---|---|---|
| committer | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-07-28 15:07:12 +0200 |
| commit | 310ac404f25b412c5c1ead12247b4eb36e9f0025 (patch) | |
| tree | 6e1dcc5e1f85a483cef7044d341b7c940c1690a8 /internal/calendar/temporal.go | |
| parent | 44472bbe31475a3c672ae003d928d7caffb4b50a (diff) | |
| parent | c5abf87fa7198c8f245f407774e2326e4b6c9b9c (diff) | |
| download | lectio-310ac404f25b412c5c1ead12247b4eb36e9f0025.tar.gz lectio-310ac404f25b412c5c1ead12247b4eb36e9f0025.zip | |
Merge branch 'engine-precedence-fixes': OF/EF calendar+readings flawlessness pass
Per-day validation vs litcal (OF) and missalemeum (EF) 2005-2050, all defects
fixed and re-validated to zero: OF calendar 0 real errors forward, OF readings
0 unresolvable, EF 0 reading gaps + resumed Sundays correct.
Diffstat (limited to 'internal/calendar/temporal.go')
| -rw-r--r-- | internal/calendar/temporal.go | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/internal/calendar/temporal.go b/internal/calendar/temporal.go index b0dc653..1c8d74f 100644 --- a/internal/calendar/temporal.go +++ b/internal/calendar/temporal.go @@ -117,6 +117,15 @@ func ferialDay(season Season, slug string, col Colour, week int, privFeria bool) Cel: Celebration{Slug: slug, Rank: RankFerial, Colour: col, Layer: "temporal"}} } +// privFerialDay builds a band-2 privileged weekday (Ash Wednesday, Holy Week +// Monday-Wednesday): a ferial no sanctoral feast or memorial can displace (only +// a solemnity may, and solemnities transfer off it -- Table of Liturgical Days +// #2). Distinct from ferialDay's PrivFeria (band 9) Lenten/Advent weekdays. +func privFerialDay(season Season, slug string, col Colour, week int) temporalDay { + return temporalDay{Season: season, Colour: col, Week: week, Rank: RankFerial, Privileged: true, + Cel: Celebration{Slug: slug, Rank: RankFerial, Colour: col, Layer: "temporal"}} +} + // temporal computes the temporal identity of date under the given Selection. func temporal(date time.Time, sel Selection) temporalDay { date = date.UTC().Truncate(24 * time.Hour) @@ -180,11 +189,16 @@ func temporal(date time.Time, sel Selection) temporalDay { if sun { return sundayDay(Lent, "palm-sunday", Red, 6) } - return ferialDay(Lent, "holy-week-"+weekdayAbbr(wd), Violet, 6, true) + // Holy Week Mon-Wed are band-2 privileged: no feast/memorial is kept. + return privFerialDay(Lent, "holy-week-"+weekdayAbbr(wd), Violet, 6) case !date.Before(ashWed) && date.Before(palmSunday): // Lent - if !date.Before(ashWed) && date.Before(ashWed.AddDate(0, 0, 4)) { - // Ash Wednesday through the Saturday after (before Lent I). + if sameDay(date, ashWed) { + // Ash Wednesday is band-2 privileged (suppresses any coinciding feast). + return privFerialDay(Lent, "lent-after-ashes-wed", Violet, 0) + } + if date.Before(ashWed.AddDate(0, 0, 4)) { + // Thursday-Saturday after Ash Wednesday (before Lent I): band-9 privileged. return ferialDay(Lent, "lent-after-ashes-"+weekdayAbbr(wd), Violet, 0, true) } lent1 := nextWeekday(ashWed, time.Sunday) |
