Created
July 2, 2022 20:31
-
-
Save igneus/e558ed8ffb34447dcb5c18050b6198d1 to your computer and use it in GitHub Desktop.
Which Ordinary time Sundays were not celebrated in the given liturgical year?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Which Ordinary time Sundays were not celebrated in the given liturgical year? | |
require 'calendarium-romanum/cr' | |
SUNDAYS = (2..33).to_a.freeze | |
SANCTORALE = CR::Data::GENERAL_ROMAN_ENGLISH.load | |
def skipped_sundays(year) | |
cal = CR::Calendar.new year, SANCTORALE | |
r = SUNDAYS.dup | |
date = cal.temporale.start_date | |
loop do | |
date += 7 | |
begin | |
day = cal[date] | |
rescue RangeError | |
break | |
end | |
r.delete day.season_week if day.season == CR::Seasons::ORDINARY && day.celebrations[0].rank.sunday? | |
end | |
r | |
end | |
(2010..2030).each do |year| | |
print "#{year}/#{year+1}: " | |
puts skipped_sundays(year).collect(&:to_s).join(', ') | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment