Our church’s website has a border on the home page, coloured a forest green.
I got to thinking: would it be possible to have the website coded so that it automatically changed the colour of the border to match the colours of the liturgical year? Purple for Lent and Advent, white for Easter and Christmas-tide, green for ordinary time, and so on? How difficult or easy would that type of coding be?
Any web developer or designer ought to be able to do it. They’d probably bill an hour or two’s work depending on your web site platform and various details.
Working out dates is a notoriously difficult simple problem (witness the many program which thought that 2000 would not be a leap year), and church dates are a notoriously difficult type of simple date calculation (because cycles of the moon are combined with cycles of the sun, including leap years and leap months)
I’d give you even money that you get an error in the dates, even if you do it by typing in a large table copied out of your published documentation.
Yes, this is doable. You could do it with something like PHP and have the color property conditionalized on the result of an algorithm. Of course, liturgical calendars can be pretty complex (e.g. requiring harmonizing solar and lunar cycles), so you might be better off instead implementing a call to some third-party site rather than do all the math yourself.
In pseudocode, it might look like this:
if (condition for Lent) { Color= Purple}
if (condition for Easter} {Color = White}
if (condition for Pentecost} {Color = Yellow}
if (condition for Advent} {…
if (condition for Christmas} {…
else {color = green}
Yeah, I second the call to some sort of online api, if there is one.
It could be as simple as setting a variable when you want to change things in your admin panel. The low tech way of doing this would be to make sure that border colors are declared in a css file, and then switch out the classes in the HTML when needed.
The problem is pretty straightforward. The only variable to account for is the day Easter falls on and everything is either an offset from that day like Pentecost or constant days like Advent. You could probably crank it out in javascript.
Was just reading up on this, since I didn’t really know anything about it. It does seem pretty straightforward. I can probably whip something up by tomorrow, Norther Piper, if you can wait that long.
That’s overcomplicating things. The dates are predictable, you just need a table of dates for the next 20 years or so. The church should be able to provide that.
This should be pretty simple. There are plenty of easily-programmable algorithms available that will calculate the date of Easter for any given calendar year. I use one to print an Ordo each year. Once the date of Easter (E) is known the other dates follow easily e.g. Lent begins on Ash Wednesday, which is E-46; Pentecost is on E+49 etc.
Advent is programmed to start on the Sunday falling between 27 November and 3 December.
Thanks for the offer! You meant the calculation of dates, right? Not actual code to make it work in our web-page? (Sorry if that’s a naive question, but I know nothing about how web-pages actually work.)
Advent (and the Sunday next before Advent, Stir-up Sunday) is the tricky one, since it doesn’t start a fixed number of days before Christmas. I think you’d have to program those specific dates for each year, wouldn’t you?