aboutsummaryrefslogtreecommitdiff
path: root/internal/calendar/calendar.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/calendar/calendar.go')
-rw-r--r--internal/calendar/calendar.go19
1 files changed, 19 insertions, 0 deletions
diff --git a/internal/calendar/calendar.go b/internal/calendar/calendar.go
index d224e87..9f24caf 100644
--- a/internal/calendar/calendar.go
+++ b/internal/calendar/calendar.go
@@ -145,10 +145,29 @@ func movableMemorialsOF(y int) []movableCel {
// transferIfImpeded moves a solemnity off a band-1/2 temporal day to the next
// free day. Non-solemnities are never transferred (they yield instead).
+//
+// Two impeded solemnities are ANTICIPATED (moved earlier) rather than deferred,
+// matching the General Roman Calendar's published transfers:
+// - St Joseph (Mar 19) falling in Holy Week goes to the Saturday before Palm
+// Sunday. (The Annunciation, by contrast, defers past the octave via the
+// generic forward walk below -- to the Monday after the 2nd Sunday of Easter.)
+// - The Nativity of St John the Baptist (Jun 24), when the day is a solemnity
+// of the Lord (the Sacred Heart or Corpus Christi falling on Jun 24), goes
+// to Jun 23.
func transferIfImpeded(cel Celebration, when time.Time, sel Selection) time.Time {
if cel.Rank != RankSolemnity {
return when
}
+ if strings.Contains(cel.Slug, "joseph-husband") {
+ if palm := Easter(when.Year()).AddDate(0, 0, -7); !when.Before(palm) {
+ return palm.AddDate(0, 0, -1) // Holy Week -> Saturday before Palm Sunday
+ }
+ }
+ if strings.Contains(cel.Slug, "john-the-baptist") {
+ if td := temporal(when, sel); td.Cel.Rank == RankSolemnity && td.Class == ClassLord && !td.Sunday {
+ return when.AddDate(0, 0, -1) // Sacred Heart / Corpus Christi on Jun 24 -> Jun 23
+ }
+ }
day := when
for i := 0; i < 30; i++ {
b := temporal(day, sel)