summaryrefslogtreecommitdiff
authormickeyl <mickeyl>2005-05-06 21:11:54 (UTC)
committer mickeyl <mickeyl>2005-05-06 21:11:54 (UTC)
commit4e47752ffb1083ca4426d9c08ae1c1ceb100acdb (patch) (side-by-side diff)
tree0057cce6102ce078d52e7d2e41ef99839a9e32cb
parente8bb0ef7701e6bb565dc178424687e82b12bd8ec (diff)
downloadopie-4e47752ffb1083ca4426d9c08ae1c1ceb100acdb.zip
opie-4e47752ffb1083ca4426d9c08ae1c1ceb100acdb.tar.gz
opie-4e47752ffb1083ca4426d9c08ae1c1ceb100acdb.tar.bz2
add US holidays to nationaldays and improve README. patch courtesy Erik Hovland (erik@hovland.org) - thanks
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--etc/nationaldays/README52
-rw-r--r--etc/nationaldays/us-ca.xml35
-rw-r--r--etc/nationaldays/us-common.xml92
-rw-r--r--etc/nationaldays/us.xml49
4 files changed, 205 insertions, 23 deletions
diff --git a/etc/nationaldays/README b/etc/nationaldays/README
index 71af75b..6a1cbb5 100644
--- a/etc/nationaldays/README
+++ b/etc/nationaldays/README
@@ -1,48 +1,54 @@
-Config files for the nationalholiday plugin
+Entry files for the nationalholiday plugin
-Format is simple:
-Standard-xml file.
-It must always enclosed by
+The format is simple. It is a standard xml file. So all tags must closed. A
+handy tool for checking closed tags is the xmllint utility provided by
+libxml2.
+
+Each xml file is enclosed by:
<nationaldays>
...
</nationaldays>
-then a short description tag.
+Each <nationaldays> tag should be follwed by a short description tag:
<description value="german holidays"/>
-for example. It should be used later on.
-
-then a list of holidays follows, encapsulated with
+The description will probably be used later on. Follow the description with
+the <entries> enclosure:
<entries>
...
</entries>
-A non-floating holiday entry has the form
-<entry date="M-D" name="description of holiday"/>
+Insert your holidays in either fixed or floating format. A fixed holiday entry
+has the form:
+<entry name="description of holiday" date="M-D" />
-floating holidays:
+A floating holiday entry has the form:
<entry name="<name>" type="floating">
<calculation>
... calc entries ..
</calculation>
</entry>
-The calcentries may following tags:
-
-date - a short date (without Year!) in form M-D or the string "easter"
-offset - integer. these days will added (or substracted) after all other calcs are made.
-weekday - the day of week as monday, tuesday and so on.
-dayofmoth - in combination with weekday you can say "first <weekday> of ..." or "second <weekday> of ..."
-month - monthname(!) eg. january, february and so on.
-datedep - dependy to "date", may "before" or "after".
-
-example:
+The calc entries may have the following tags:
+date - A short date (without Year!) in the form M-D or the special string
+ "easter"
+offset - A signed integer. This will added (or substracted) after all other
+ calculations are made.
+weekday - The day of week as in "monday', "tuesday", "wednesday", "thursday",
+ "friday", "saturday" or "sunday".
+dayofmonth - Used in combination with weekday tag. You can use "first",
+ "second", "third", "fourth" or "last".
+month - Used in combination with weekday and/or dayofmonth eg. "january",
+ "february" and so on.
+datedep - Used in combination with date and/or weekday, may "before" or "after".
+
+example calculation entry:
<calculation>
<weekday value="sunday"/>
<datedep value="before"/>
<date value="12-24"/>
</calculation>
-these will calculate sunday before christmaseve or christmas eve itself if it is a sunday.
+this will calculate sunday before christmas eve or christmas eve itself if it is a sunday.
-see german.xml for futher examples.
+see german.xml or any of the .xml files in this directory for futher examples.
diff --git a/etc/nationaldays/us-ca.xml b/etc/nationaldays/us-ca.xml
new file mode 100644
index 0000000..bfdec4a
--- a/dev/null
+++ b/etc/nationaldays/us-ca.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<nationaldays>
+<description value="Californian Holidays"/>
+<entries>
+<entry name="Martin Luther King, Jr.'s Birthday Observed" type="floating">
+ <calculation>
+ <weekday value="monday"/>
+ <datedep value="after"/>
+ <date value="01-15"/>
+ </calculation>
+</entry>
+<entry name="Cesar Chavez's Birthday" date="03-31"/>
+<entry name="Daylight Savings (spring forward)" type="floating">
+ <calculation>
+ <dayofmonth value="first"/>
+ <weekday value="sunday"/>
+ <month value="april"/>
+ </calculation>
+</entry>
+<entry name="Columbus Day" type="floating">
+ <calculation>
+ <dayofmonth value="second"/>
+ <weekday value="monday"/>
+ <month value="october"/>
+ </calculation>
+</entry>
+<entry name="Daylight Savings (fall back)" type="floating">
+ <calculation>
+ <dayofmonth value="last"/>
+ <weekday value="sunday"/>
+ <month value="october"/>
+ </calculation>
+</entry>
+</entries>
+</nationaldays>
diff --git a/etc/nationaldays/us-common.xml b/etc/nationaldays/us-common.xml
new file mode 100644
index 0000000..70aaa58
--- a/dev/null
+++ b/etc/nationaldays/us-common.xml
@@ -0,0 +1,92 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<nationaldays>
+<description value="US Commonly Celebrated Holidays"/>
+<entries>
+<entry name="Groundhog Day" date="02-02"/>
+<entry name="Valentine's Day" date="02-14"/>
+<entry name="St. Patrick's Day" date="03-17"/>
+<entry name="April Fool's Day" date="04-01"/>
+<entry name="Earth Day" date="04-22"/>
+<entry name="Bring Your Children to Work Day" type="floating">
+ <calculation>
+ <dayofmonth value="fourth"/>
+ <weekday value="thursday"/>
+ <month value="april"/>
+ </calculation>
+</entry>
+<entry name="Secretaries' Day" type="floating">
+ <calculation>
+ <dayofmonth value="last"/>
+ <weekday value="saturday"/>
+ <month value="april"/>
+ <offset value="-3"/>
+ </calculation>
+</entry>
+<entry name="Arbor Day" type="floating">
+ <calculation>
+ <dayofmonth value="last"/>
+ <weekday value="friday"/>
+ <month value="april"/>
+ </calculation>
+</entry>
+<entry name="May Day" date="05-01"/>
+<entry name="Cinco de Mayo" date="05-05"/>
+<entry name="National Teacher's Day" type="floating">
+ <calculation>
+ <dayofmonth value="first"/>
+ <weekday value="tuesday"/>
+ <month value="may"/>
+ </calculation>
+</entry>
+<entry name="Mother's Day" type="floating">
+ <calculation>
+ <dayofmonth value="second"/>
+ <weekday value="sunday"/>
+ <month value="may"/>
+ </calculation>
+</entry>
+<entry name="Emancipation Day" date="06-20"/>
+<entry name="Summer Solstice" date="06-21"/>
+<entry name="Father's Day" type="floating">
+ <calculation>
+ <dayofmonth value="third"/>
+ <weekday value="sunday"/>
+ <month value="june"/>
+ </calculation>
+</entry>
+<entry name="Gay Pride Day" type="floating">
+ <calculation>
+ <dayofmonth value="last"/>
+ <weekday value="sunday"/>
+ <month value="june"/>
+ </calculation>
+</entry>
+<entry name="Grandparent's Day" type="floating">
+ <calculation>
+ <dayofmonth value="first"/>
+ <weekday value="monday"/>
+ <month value="september"/>
+ <offset value="+6"/>
+ </calculation>
+</entry>
+<entry name="Patriot Day" date="09-11"/>
+<entry name="Fall Equinox" date="09-23"/>
+<entry name="National Children's Day" date="10-12"/>
+<entry name="Bosses Day" date="10-16"/>
+<entry name="Mother-in-Law's Day" date="10-23"/>
+<entry name="Halloween" date="10-31"/>
+<entry name="Election Day" type="floating">
+ <calculation>
+ <dayofmonth value="first"/>
+ <weekday value="monday"/>
+ <month value="november"/>
+ <offset value="+1"/>
+ </calculation>
+</entry>
+<entry name="Pearl Harbor Day" date="12-07"/>
+<entry name="Human Rights Day" date="12-10"/>
+<entry name="Forefathers' Day" date="12-21"/>
+<entry name="Winter Solstice" date="12-21"/>
+<entry name="New Year's Eve" date="12-31"/>
+</entries>
+</nationaldays>
diff --git a/etc/nationaldays/us.xml b/etc/nationaldays/us.xml
new file mode 100644
index 0000000..fc75b86
--- a/dev/null
+++ b/etc/nationaldays/us.xml
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<nationaldays>
+<description value="US Holidays"/>
+<entries>
+<entry name="New Year's Day" date="01-01"/>
+<entry name="Martin Luther King, Jr.'s Birthday" date="01-15"/>
+<entry name="President's Day" type="floating">
+ <calculation>
+ <dayofmonth value="third"/>
+ <weekday value="monday"/>
+ <month value="february"/>
+ </calculation>
+</entry>
+<entry name="Memorial Day" type="floating">
+ <calculation>
+ <dayofmonth value="last"/>
+ <weekday value="monday"/>
+ <month value="may"/>
+ </calculation>
+</entry>
+<entry name="Flag Day" date="06-14"/>
+<entry name="Independence Day" date="07-04"/>
+<entry name="Labor Day" type="floating">
+ <calculation>
+ <dayofmonth value="first"/>
+ <weekday value="monday"/>
+ <month value="september"/>
+ </calculation>
+</entry>
+<entry name="Veteran's Day" date="11-11"/>
+<entry name="Thanksgiving" type="floating">
+ <calculation>
+ <dayofmonth value="last"/>
+ <weekday value="thursday"/>
+ <month value="november"/>
+ </calculation>
+</entry>
+<entry name="Day after Thanksgiving" type="floating">
+ <calculation>
+ <dayofmonth value="last"/>
+ <weekday value="thursday"/>
+ <month value="november"/>
+ <offset value="+1"/>
+ </calculation>
+</entry>
+<entry name="Christmas Eve" date="12-24"/>
+<entry name="Christmas Day" date="12-25"/>
+</entries>
+</nationaldays>