This is a bigger and more involved project than I think a lot of people will realize. One of my recent side projects was a Mastodon bot that posts a daily verse from the Episcopal Hymnal 1982 (botsin.space/@hymnal1982), and getting it to reflect the liturgical calendar was a job and a half. (It missed all of Christmas after Christmas Day; have to go debug that.)
A little while back I wrote some code to calculate a liturgical calendar based on pre-60s rubrics. [1] It was a fairly complicated project. There have been a few edge cases that have come up over the years. (E.g., if Christmas Eve is on a Sunday, does it take precedence over the 4th Sunday of Advent? If the Feast of St. John falls on the Feast of the Sacred Heart, which takes precedence?)
https://github.blog/2021-05-13-video-uploads-available-githu...