diff options
Diffstat (limited to 'internal/calendar')
| -rw-r--r-- | internal/calendar/temporal_ef.go | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/internal/calendar/temporal_ef.go b/internal/calendar/temporal_ef.go index 151bd1b..6f641f4 100644 --- a/internal/calendar/temporal_ef.go +++ b/internal/calendar/temporal_ef.go @@ -2,6 +2,7 @@ package calendar import ( "strconv" + "strings" "time" ) @@ -124,11 +125,24 @@ func temporalEF(date time.Time) temporalDay { } return efCel(season, "ef-"+string(season)+"-sunday-"+strconv.Itoa(week), col, rank, week) } + // The days between Ash Wednesday and the 1st Sunday of Lent have their own + // proper Masses (not part of a numbered Lenten week). + if season == Lent && date.Before(easter.AddDate(0, 0, -42)) { + return efCel(Lent, "ef-lent-after-ashes-"+weekdayLower(date), Violet, RankClass3, 0) + } + week := efWeek(date, season, y, easter) rank := RankClass4 // per-annum feria if season == Advent || season == Lent || season == Passiontide || season == Septuagesima { rank = RankClass3 // penitential ferias rank higher } - return efCel(season, "ef-"+string(season)+"-feria", col, rank, efWeek(date, season, y, easter)) + // Unique ferial slug (season-week-weekday) so proper ferias (Lent, Advent, + // Holy Week, Ember days) can key their own readings; green-season ferias + // simply have no lectionary entry and fall back to the Sunday. + return efCel(season, "ef-"+string(season)+"-"+strconv.Itoa(week)+"-"+weekdayLower(date), col, rank, week) +} + +func weekdayLower(d time.Time) string { + return strings.ToLower(d.Weekday().String()) } // efWeek is a best-effort week-within-season number for display (not |
