Skip to content

Instantly share code, notes, and snippets.

@igneus
Created July 2, 2022 20:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save igneus/e558ed8ffb34447dcb5c18050b6198d1 to your computer and use it in GitHub Desktop.
Save igneus/e558ed8ffb34447dcb5c18050b6198d1 to your computer and use it in GitHub Desktop.
Which Ordinary time Sundays were not celebrated in the given liturgical year?
# 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