Programming Kalendars

Back when I first got serious about coding the Breviary—I guess it’s been a couple of years now—I talked to Fr. Chris about it and we discovered that we’d been doing some parallel development.

One of the first issues to tackle is how to figure out what “today” is liturgically. Both Fr. Chris and I approached it the same way. That is, we take “today’s” date as given to us either by the server or the local computer then a) run it through an algorithm to determine where you are in the temporal cycle, then b) compare it to a table to determine if there’s something sanctoral going on.

What I kept running up against was the problem of transference. There are certain circumstances when a feast must be moved from its original date. For instance, Major Feasts that fall in Holy Week and the Octave of Easter are transferred by order of occurrence into the Second Week of Easter (cf. BCP, p. 17). Too, Major Feasts that fall on Sundays outside of green seasons must be transferred; major feasts in green seasons may be transferred.

At one point, for the sake of moving forward, I threw up my hands and said enough… It seemed easier to simply create a table for the year and to work everything out ahead of time. This saved me the trouble of coding transference. What it created was:

  • more moving parts. Currently I have a kalendar code that must correspond to the same code in the collect table and the lectionary table. Some of the recent Scripture reading issues (like the one that occurred today…) was the result of a perfectly normal and legal kalendar code that didn’t synch up with the lectionary code (though it did with the collect code…).
  • setting aside a block of time at the right time to work out a year’s worth of dates. And ends of years tend to be busy times. I’m clear through the end of 2010, but if it goes further…?
  • A restriction to the dates that I have a coded table for. This is less an issue with the St Bede’s Breviary than some historical projects I have in mind. For instance—what if I wanted to know what liturgy was appointed for February 18th in 892? There’s no way I’m going to code tables for thousand year spans!!

As a result, I’m rethinking my decision. This won’t happen immediately—it may not happen for quite a while, actually—but I think the issue can be broken down more logically than I was considering before. So what would this look like?:

  • Get the date
  • Run the temporal algorithm and determine where we are in the year
  • Now–different pie (sets of kalendrical rules not pastries) have different rules for privileged octaves and when transferences happen. So, this is where each kalendar system will have to have its own algorithm. Within those, however, things may not be so bad. For instance for the ’79 BCP all I should have to do is add in a three step process:
    • Is today the Monday after Easter 2? If no, keep going, if yes, then see if we need St Joseph, the Annunciation,  St Mark, or SS Phillip & James.
    • Is today the Tuesday after Easter 2? If no, keep going, if yes, see if we need the Annunciation.
    • Is today a Monday not in a Green season? If no, keep going, if yes, see if yesterday was a major feast
  • Now check today in the Sanctoral cycle to see if anything needs to be celebrated.

I think there may be some real benefits to this approach—I’ll keep thinking about it…