Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optional German holidays, descriptions #24

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<version>4.13.1</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
11 changes: 7 additions & 4 deletions src/main/resources/holidays/Holidays_de.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<tns:Configuration hierarchy="de" description="Germany" xmlns:tns="http://www.example.org/Holiday" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.example.org/Holiday /Holiday.xsd">
<tns:Configuration hierarchy="de" description="Deutschland" xmlns:tns="http://www.example.org/Holiday" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.example.org/Holiday /Holiday.xsd">
<tns:Holidays>
<tns:Fixed month="JANUARY" day="1" descriptionPropertiesKey="NEW_YEAR"/>
<tns:Fixed month="MAY" day="1" descriptionPropertiesKey="LABOUR_DAY"/>
<tns:Fixed month="JUNE" day="17" validFrom="1954" validTo="1990" descriptionPropertiesKey="UNIFICATION"/><!-- Tag der deutschen Einheit bis 1990 -->
<tns:Fixed month="OCTOBER" day="3" validFrom="1990" descriptionPropertiesKey="UNIFICATION_GERMANY"/><!-- Tag der Deutschen Einheit ab 1990 -->
<tns:Fixed month="OCTOBER" day="31" validFrom="2017" validTo="2017" descriptionPropertiesKey="REFORMATION_DAY"/>
<tns:Fixed month="DECEMBER" day="25" descriptionPropertiesKey="FIRST_CHRISTMAS_DAY"/>
<tns:Fixed month="DECEMBER" day="26" descriptionPropertiesKey="SECOND_CHRISTMAS_DAY"/>
<tns:Fixed month="DECEMBER" day="25" descriptionPropertiesKey="CHRISTMAS"/>
<tns:Fixed month="DECEMBER" day="26" descriptionPropertiesKey="STEPHENS"/>
<tns:Fixed month="DECEMBER" day="24" descriptionPropertiesKey="CHRISTMAS_EVE" localizedType="UNOFFICIAL_HOLIDAY"/>
<tns:Fixed month="DECEMBER" day="31" descriptionPropertiesKey="NEW_YEARS_EVE" localizedType="UNOFFICIAL_HOLIDAY"/>
<tns:ChristianHoliday type="EASTER" />
<tns:ChristianHoliday type="GOOD_FRIDAY"/>
<tns:ChristianHoliday type="EASTER_MONDAY"/>
<tns:ChristianHoliday type="ASCENSION_DAY"/>
Expand All @@ -33,7 +36,7 @@
<tns:Fixed month="NOVEMBER" day="1" descriptionPropertiesKey="ALL_SAINTS"/>
<tns:ChristianHoliday type="CORPUS_CHRISTI" />
</tns:Holidays>
<tns:SubConfigurations hierarchy="mu" description="Munich">
<tns:SubConfigurations hierarchy="mu" description="München">
<tns:Holidays>
<tns:Fixed day="15" month="AUGUST" descriptionPropertiesKey="ASSUMPTION_DAY"/>
</tns:Holidays>
Expand Down
5 changes: 3 additions & 2 deletions src/test/java/de/jollyday/tests/HolidayDETest.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,9 @@ public void testManagerDEinterval() {
HolidayManager instance = HolidayManager.getInstance(HolidayCalendar.GERMANY);
Set<Holiday> holidays = instance.getHolidays(calendarUtil.create(2010, 10, 1), calendarUtil
.create(2011, 1, 31));
List<LocalDate> expected = Arrays.asList(calendarUtil.create(2010, 12, 25),
calendarUtil.create(2010, 12, 26), calendarUtil.create(2010, 10, 3),
List<LocalDate> expected = Arrays.asList(calendarUtil.create(2010, 12, 24),
calendarUtil.create(2010, 12, 25), calendarUtil.create(2010, 12, 26),
calendarUtil.create(2010, 12, 31), calendarUtil.create(2010, 10, 3),
calendarUtil.create(2011, 1, 1));
Assert.assertEquals("Wrong number of holidays", expected.size(), holidays.size());
for (LocalDate d : expected) {
Expand Down