Holidays 3.9 build: 9205 released: 2008-06-21 Calculates when holidays occur in any given year. Copyright (c) 2008 Canadian Mind Products. Java Applet (that can also be run as an application). Download from http://mindprod.com/products1.html#HOLIDAYS ===> Free <=== Full source included. You may even include the source code, modified or unmodified in commercial programs that you write and distribute. May be used freely for any purpose but military. For more details on this restriction, see http://mindprod.com/roedy.html#NONMILITARY If you include any Canadian Mind Products code in your own applications, your app too must be labeled non-military use only. All Java jars and source code are included. ---- Prerequisites: This program runs under any OS, (e.g. Win2K/XP/Vista/OSX/Linux/Solaris/Vista64/AIX...) so long as you have <><> Java version 1.5 <><> or later installed. See http://mindprod.com/jgloss/installingjava.html for details. ---- Installing on a PC: Download source and compiled class files to run on your own machine as an application or Applet. First install a recent Java JDK or JVM. See http://mindprod.com/jgloss/installingjava.html. To install, extract the zip download with WinZip (or similar unzip utility) into any directory you please, often J:\ -- ticking off the "user folder names" option. To run as an application,type: java -jar J:\com\mindprod\holidays\holidays.jar parms adjusting as necessary to account for where the jar file is. ---- Installing on a MacIntosh: Use Safari to download source and compiled class files to run on your own machine as an application or Applet. Safari will automatically unpack the zip into ~/Downloads (version 10.5) [or on the Desktop (version 10.4 and earlier)]. First install a recent Java JDK or JVM. See http://mindprod.com/jgloss/installingjava.html. You may optionally move the download tree to a permanent home. To run as an application, without parameters, just double click the jar file. To run as an application with parameters, in bash shell type: open Terminal.app cd ~/Desktop java -jar com/mindprod/holidays/holidays.jar parms adjusting as necessary to account for where the jar file is. I don't have a MacIntosh, just a PC, so I can't test the programs for Mac compatibility. In theory they should work without problems, but in practice that does not always happen. If you have problems please, let me know, preferably with screenshots and complete verbatim error messages. ---- Rebuilding: The zip already contains the necessary class and jar files, so unless you modify the program, there is no need to recompile the source or rebuild the jar. Configure basedir="E:/" in rebuild.xml to the drive where your files are. Use ANT and rebuild.xml, not build.xml, to recompile and recreate the jar. ---- Use: Caculates when various holidays occur in any given year BC or AD. Designed to be cannibalised to include the calculation routines in your own programs. It can also be used as an Applet or a standalone application. It currently calculates 58 holidays including the following: New Years Day Congress Start Day Martin Luther King Day Inauguration Day Robbie Burns Day Australia Day Groundhog Day Mardi Gras Ash Wednesday Lincoln's Birthday Valentines Day Presidents Day Alberta Family Day Washington's Birthday Commonwealth Day St Patrick's day Vernal Equinox Palm Sunday Good Friday April Fools Day Earth Day Easter Sunday Easter Monday ANZAC Day Cinco de Mayo Europe Day Mothers Day Armed Forces Day Victoria Day Memorial Day Australia Queen's Birthday Fathers Day Summer Solstice Aboriginal Day St Jean-Baptiste Day Canada Day Independence Day Utah Pioneer Day Parents' Day Canada Civic Day Canadian Labour Day American Labor Day Grandparents Daay Autumnal Equinox Canadian Thanksgiving Columbus Day Halloween General Election Day Remembrance Day Veterans Day American Thanksgiving Human Rights Day Winter Solstice Christmas Eve Christmas Christmas in the USA Boxing Day New Years Eve If a holiday was not celebrated in a given year, it will not show. Includes complete Java source code to calculate when the holiday occurs in a given year, when it was first celebrated, when first proclaimed, the rule for how it is calculated in words and an authority to go to for more information. Also calculates the nearest weekday to any given holiday, when you actually get the day off. This is what I refer to by the term "shifted". Boxing day has special shift handling. In the source are methods that can also be used to calculate how many business days were between given dates. It is quite easy to specify which days you want considered as holidays using methods like addHoliday where you specify the date or the name of the Holiday, addAmericanFederalHolidays and addWeekDaysAsHolidays. The main holiday still missing is Chinese New Year, the second new moon after Winter solstice. Since it is an astronomical moment, the civil calendar day it occurs on depends on timezone. There is an additiontal package of German holidays designed to work in the Holidays framework available from http://www.applicate.de/freesoftware/holiday/ One typical use embedding in your own program: public class DemoGermanHolidayUtils { public static void main(String[] args) { // 1. Enable calculation from 1995 to 2010 IsHoliday holiday = new IsHoliday(1995, 2010); // 2. Mark weekends as holidays holiday.addWeekendsAsHolidays(); // 3. Add German federal holidays GermanHolidayUtils.addGermanFederalHolidays(holiday); System.out.print("Is May 1st 2002 a holiday: "); System.out.println(holiday.isHoliday( new BigDate(2002, 5, 1))); } } To install, Extract the zip download with WinZip, available from http://www.winzip.com (or similar unzip utility) into any directory you please, often C:\ -- ticking off the "user folder names" option. To run as an application, type: java -jar C:\com\mindprod\holidays\holidays.jar adjusting as necessary to account for where the jar file is. Why the turkey icon? It represents the holiday feasts of Thanksgiving and Christmas. The distributed version is absolutely identical to the registered version, and includes Java source. You may use the code freely in your own programs. You don't need to register multiple copies. Version History 1.8 makes it easier to extend the various classes for your own purposes, e.g. to print a calendar of German holidays. 1.9 improves the JavaDoc. 2.0 adds Earth Day. 2.2 adds consistent bat files. 2.3 adds an about box. 2.4 adds JavaDoc and ant builds. 2.5 adds Human Rights Day. 2.7 adds Europe Day 2.8 adds CongressSessionStartDay 2.9 uses 2007 as the default year. 3.0 tidy code. 3.1 2007-05-22 add PAD and icon, more IntelliJ inspect tidying. 3.2 2007-10-10 additional notes. 3.3 2007-10-13 UK vs US Christmas, calculate when get day off. 3.4 2007-12-19 display year for verification. 3.5 2008-01-25 add Australia Day 3.6 2008-02-02 add ANZAC day, Australian Queen's Birthday 3.7 2008-02-07 add Mardi Gras 3.8 2008-03-20 convert to JDK 1.5, sort holidays, tidy word wraps, used of rsquo 3.9 2008-06-21 add Aboriginal Day