Computing Easter Sunday
For a recent project, the customer wanted to use holidays including Easter Sunday. Some holidays are fixed (Christmas Day, New Year's Day), and some float within reason (Labor Day is the first Monday in September, for example). Easter is a different animal. It has to do with the full moon and the spring equinox. After searching the internet, I found I relatively simple formula for computing Easter Sunday.

I'm not going to sit here and claim to know how it works. But the web site claimed to correctly compute Easter Sunday from 1900 to 2099. It even talked about four specific years where the base computation was a week off, so I felt pretty confident with the computation. I put everything into a script library that could be reused to compute the date for Easter Sunday. The function takes an integer year and returns a NotesDateTime object. If the passed-in year is less than 1900 or geater than 2099, then the function returns the keyword Nothing. Here is the function:

Function EasterSunday(inpYear As Integer) As NotesDateTime
' Compute Easter Sunday if the year is in the range 1900 to 2099. If the year is outside
' of that range, return NOTHING.
Dim a As Integer
Dim b As Integer
Dim c As Integer
Dim d As Integer
Dim e As Integer
Dim tempDate As Variant
Dim retVal As NotesDateTime

If inpYear < 1900 Or inpYear > 2099 Then
Set EasterSunday = Nothing
Exit Function ' =====================
End If
a = inpYear Mod 19
b = inpYear Mod 4
c = inpYear Mod 7
d = ( (a*19) + 24) Mod 30
e = ( (b*2) + (c*4) + (d*6) + 5) Mod 7
If (22+d+e) <= 31 Then
tempDate = Datenumber(inpYear, 3, (22+d+e))
Else
tempDate = Datenumber(inpYear, 4, (d+e-9))
End If
Set retVal = New NotesDateTime(tempDate)
If ( (inpYear = 1954) Or (inpYear = 1981) Or (inpYear = 2049) Or (inpYear = 2076) ) Then