by Neil Rieck
Unlike many Java Applets Calendars which are based upon the "Date"
function,
this one is based upon the "GregorianCalendar" function which was
introduced in JDK1.1
The "correction date" is defaulted to October 15, 1582.
where Pope Gregory authorized the removal of 10 days.
(along with special leap-year cases for 100 and 400 year boundaries)
click here if the applet doesn't initialize
Easter was originally linked to Passover, but in the year 325 AD at the council at Nicaea, it was decided that Easter would be celebrated on the first Sunday following the first full moon on, or after, the vernal equinox (the passing from winter into spring). In the year 325, the vernal equinox was assumed to be fixed at March 21.
Due to inaccuracies in the Julian calendar, by the 16th century the vernal
equinox was occurring on March 11. This caused problems for the church in Rome
because most Christians outside of Rome were using the calendar date of "March
21" to calculate the day of Easter rather than the "vernal equinox" event.
(sometimes bad weather combined with a lack of local astronomers make the
calendar method the only practical choice). This had the effect of pushing the
celebration day of Easter closer toward summer.
Note: Christmas was a relatively unimportant church event in those days and
was created only to obscure pagan rituals like The Feast of Saturnalia etc. The
changing of these calendars is one reason why eastern Europe celebrates
Christmas on Jan 6 but I'll leave that for another time partly because that
correction involves 12 days.
Pope Gregory XIII assigned the problem to a Jesuit astronomer named Christopher Schlussel (a.k.a. Clavius) who suggested that the equinox problem could be solved by removing 10 days from the current year but from that time forward, the Christian world should adopt the idea proposed by Aloysius Lilius. The plan was approved by Pope Gregory who decreed that October 4, 1582 would be followed by October 15. The peasants revolted thinking that their lives had been shortened by that much. The new calendar was named the Gregorian calendar after the pope who approved the changes.
This so-called "continental calendar" wasn't adopted by England, or its colonies including America, until 1752. At that time, 11 days3b needed to be removed. (10 for the original correction, 1 for 1600, 0 for 1700)
Superscript Notes:
| rule | test | result | leap year? | calendar |
|---|---|---|---|---|
| 1 | current year/400 | = 0 <> 0 |
yes (so exit) ??? (do next test) |
Gregorian |
| 2 | current year/100 | = 0 <> 0 |
no (so exit) ??? (do next test) |
Gregorian |
| 3 | current year/4 | = 0 <> 0 |
yes no |
Julian |
| rule | test | result | leap year? | calendar |
|---|---|---|---|---|
| 1 | current year/4 | <> 0 = 0 |
no (so exit) ??? (so do next test) |
Julian |
| 2 | current year/100 | <> 0 = 0 |
yes (so exit) ??? (so do next test) |
Gregorian |
| 3 | current year/400 | <> 0 = 0 |
no yes |
Gregorian |
| Year 2 | Year 1 | year difference |
sec/year error |
total seconds error |
equiv days |
notes | |
|---|---|---|---|---|---|---|---|
| a | 1582 AD | 325 AD | 1257 | x 676 | = 847218 | 09.805763889 | Europe |
| b | 1752 AD | 325 AD | 1427 | x 676 | = 961798 | 11.1319213 | England and America |
More Calendar Links:
User Tips:
Possible Failure Modes:
Click here to download a free JVM from the Sun web site.
Note: "JVM 1.3" and "JVM 1.4" only support "Netscape Navigator 6" and any version of Internet Explorer. You shouldn't be using any version of Netscape Navigator that is pre version 6 (unless the web page uses the <Object> tag rather than the <Applet> tag)
Programmer Tips:
Old Browsers and/or JVMsOld Browsers with new JVMsIn a business environment your clients are usually on a high speed intranet and it's not unreasonable to to expect that everyone will have the latest browser and JVM (Java Virtual Machine). In this environment you may use the latest Java programming techniques and the latest JVMs. However, on the public internet you must assume that many people are using:
- older machines with smaller memories
- older browsers (like Netscape 4)
- earlier JVMs (like version 1.1 which is built into Netscape 4)
- older dialup technology like 28.8 kb or 56 kb modems (which means they won't be downloading a new browser or JVM just to run your applet)
For this reason if you don't want to ostracize certain segments of the public, you must program using JDK 1.1 which means you must use general graphics classes rather than Swing graphics etc.
Please note that this might be a little harder than it sounds. The calendar applet above was first written using SDK 1.3 with Swing graphics. To modify it for use with SDK 1.1 I had to do the following:
- drop the "J" prefix from each graphic class
- change code written for class Rectangle2D to just Rectangle
- find a suitable replacement for Font method getFontRenderContext()
- write some code to replace GregorianCalendar method getActualMaximum(Calendar.DAY_OF_MONTH)
Click here to download older SDK packages from Sun's archive.
Some older browsers like Netscape 4.x have a built in JVM 1.1 while other browsers don't support Java at all. You can force a browser to use an external JVM by replacing the <Applet> tags on your web pages with <Object> tags. Fortunately, this conversion is done for you when you run a program called HtmlConverter in the JDK bin directory.
Legend:
JAR Java Archive Java An object oriented programming language produced by Sun JavaScript A browser scripting language produced by Netscape (not related to Java in any way) JDK Java Development Kit JRE Java Run-time Environment (JVM and support files but no compiler or debugger) JVM Java Virtual Machine SDK Software Development Kit Swing 2nd generation graphics
Java Rev Numbers:
SDK (JDK) Marketing Basic Features Miscellaneous Notes 1.0 1.0 Introduction 1.1 1.1 Graphics
1.1 features
- Built into Netscape Navigator 4.x
1.2 Java2 Swing Graphics
1.2 features
- Swing graphic classes contain a 'J' prefix.
eg. Panel becomes JPanel, Applet becomes JApplet, etc.1.3 Java2 CORBA ORB
1.3 features
- JApplet requires 3 methods: start(), stop(), init()
- a second Timer() method was added
- Support for Open-JVM Interface (Netscape 6)
1.4 Java2 Unicode 3, XML
1.4 features
- JApplet requires 1 method: init()
Back
to Home
Neil Rieck
Kitchener - Waterloo - Cambridge, Ontario, Canada.