diff options
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) |
