Simple Holidays Code
Status: Beta
Brought to you by:
wanswong
| File | Date | Author | Commit |
|---|---|---|---|
| src | 2008-01-29 | wanswong | [r1] |
| HolidaySchedules.xsd | 2008-01-29 | wanswong | [r1] |
| HolidaySchema.png | 2008-01-29 | wanswong | [r1] |
| HolidayXML.htm | 2008-01-29 | wanswong | [r1] |
| genclient.bat | 2008-01-29 | wanswong | [r1] |
| holidays.jar | 2008-01-29 | wanswong | [r2] |
| holidays.xml | 2008-01-29 | wanswong | [r1] |
| log4j.xml | 2008-01-29 | wanswong | [r1] |
| readme.htm | 2008-01-29 | wanswong | [r1] |
<html>
<head>
<style>
body {font-family:arial,helvetica;font-size:small;}
</style>
</head>
<body>
<h1>Simple Holidays</h1>
<div style="width:75%">
For this project I use Eclipse 3.2, J2SE 1.5, JAXB 2.1.6, and Log4J. It is a simple project that I use to
decide if the current date is a holiday or not. <p/>For the holiday, you can specify holiday that occurs:
<ul style="list-style-type:circle">
<li>On exact date each year
<li>Moving within the month, e.g. third Monday on April
<li>One time only
<li>Add your own custom date, e.g. Easter.
</ul>
<h3>Requirements</h3>
<ul>
<li>Get JAXB from <a href="https://jaxb.dev.java.net">GlassFish</a> The latest version, as of this writing, is JAXB 2.1.6.
</ul>
<h2>Instruction</h2>
<ol>
<li>Review <a href="HolidayXML.htm">XML Schema</a> to get general feeling about the format.
If you modify the schema, then you need to regenerate the Java code. Use <i>genclient.bat</i>
for this.
<li>Modify <i>holidays.xml</i> to fit your needs.
<li>Ensure the range of workday, <i>START_DOW</i> and <i>END_DOW</i>, is correct.
<li>Review <i>HolidayApp.compareDates()</i> method and modify it, if necessary.
This method compares the input date against the list of holidays from the configuration file.
If it matches then it returns <i>MATCHED_WKDAY</i> or <i>MATCHED_WKEND</i> which indicates
the input date is a holiday and it falls within the workday as specified by <i>START_DOW</i>
and <i>END_DOW</i> or it falls on non workday, respectively.
</ol>
</div>
Let me know if you have suggestions or corrections. I will be glad to incoporate them in the next release. Thank you.
</body>
</html>