This JavaScript program calculates the days of the month for a given month and year. It was adapted from a BASIC program from the Astronomical
Computing column of Sky &
Telescope, July 1985.

The calculator will initialize itself, if possible, to your computer's month
and year. The month and year can be changed using the buttons on the calculator.
To advance the month or year press one of the [ >> ] keys; to
backup, press one of the [ << ] keys

Sun

Mon

Tue

Wed

Thu

Fri

Sat

Notes

The Gregorian calendar that is in common use today was instituted
by Pope Gregory in 1582 AD because the Julian calendar, in use since
45 BC, introduced an error of one day in every 128 years that had
moved the date of the vernal equinox to March 11.

In the Julian calendar a common year contained 365 days. A year was
a leap year of 366 days if it was exactly divisible by 4. This is
true in the Gregorian calendar except that century years that are
not divisible by 400 are common years; that is, 1900 and 2100 are
not leap years while 2000 is a leap year.

The
new calendar restored the vernal equinox to March 21. The numerical
algorithm of the Gregorian calendar was devised by the Neapolitan
astronomer-physician Aloysius Lilius (Luigi Lilio Ghiraldi). It
took effect in Europe's Roman Catholic countries in October of 1582;
October 4, 1582 was followed by October 15, 1582. Protestant countries
continued to use the Julian calendar until the 1700's or later