Easter Calculator

The display shows all possible dates that Easter Sunday can fall on between March 22 and April 25 inclusive, according to the Gregorian calendar. On page load the current year is shown in the input field, then to find the date of Easter click the "Submit" button", a thick green downward line is shown for Easter Sunday with the other Sundays being shown as thin blue downward lines, and the days of the week are shown above the dates. The date of Easter is also shown below the buttons.

You can go forwards or backwards in years by clicking the "+" amd "-" buttons respectively, and a new year can be selected by entering it in the input field. These buttons are only active after the submit button has been clicked, otherwise they will not work, or increment from the previous value in the input field.

To reset the display, either enter "0" or a blank in the input field and click the "Submit" button. The Sunday markers and the days of the week will be removed, the date of Easter below the buttons will be removed, and the input field will be empty. The page can be reloaded to get automatically the current year.

The Gergorian calendar first came into use in some countries in 1582, so inputs before that date are invalid. The largest allowed input is 9999, so values above that are also invalid, and additionally non-numeric inputs are also invalid.

Type the year:            

jQuery is used in conjunction with the HTML5 canvas tag to generate the display. The date of Easter is calculated with a JavaScript version of an algorithm from the mathematician Karl Friedrich Gauss in the 1800s, and represents an interesting connection between the Church and mathematics.

Unlike HTML and CSS where text and graphics can overwrite and erase any previous items displayed, when drawing on the canvas, anything previously present can still be displayed when new graphics is drawn over it. Other than erasing the whole display and drawing everything again from scratch, there are several ways of solving this, of which two are used here. Before the downward pointing green and blue lines representing Sundays are drawn, a rectangle is placed over the lower section of the display then everything within it is cleared. However, this does not appear to work very well for erasing the days of the week above the dates, so instead white rectanglar block characters using Unicode 2588 are drawn over any previous days, then new days are drawn over them. Note that the dates in the display are fixed, but the days of the week between March 22 and April 25 change each year. The dates, the months March and April, the upward tick marks and other markings that are drawn on page load do change.

Note that this page has been enhanced with mouse-over tooltips.

Click here to return to the main selection page.