There are some unpleasant inconsistencies, indeed. I’ve put Easter Sunday and Pentecost Sunday into my local copy of
Holidays_de.xml:, to test @rlkoshak 's suggestion:
and ran a few tests.
If I define
secondChristmasDay2021 = Ephemeris.getNextBankHoliday(622, "/etc/openhab2/services/Holidays_de.xml"), which happens to be a Sunday, where banks never work in Germany,
Ephemeris.isBankHoliday(622, "/etc/openhab2/services/Holidays_de.xml") returns
Ephemeris.getHolidayDescription(secondChristmasDay2021) returns “
If I define
pentecostSunday2021 = Ephemeris.getNextBankHoliday(405, "/etc/openhab2/services/Holidays_de.xml"), which is on a Sunday, too,
Ephemeris.isBankHoliday(405, "/etc/openhab2/services/Holidays_de.xml") returns
Ephemeris.getHolidayDescription(pentecostSunday2021) returns “
The Second Christmas Day of 2021 is considered to be a “bank holiday” although it’s on a Sunday (where banks would never be open in Germany, anyway).
After having been added to the config file, Pentecost Sunday of 2021 is considered a bank holiday by
getNextBankHoliday() (since it is returned as the next one), but not by
Listing a holiday in
Holidays_de.xml obviously only influences
getNextBankHoliday(), but not
isBankHoliday() - the information whether a holiday “is” a bank holiday seems to depend on other places in the code, too.
BTW: In Germany, we never speak of “bank holidays” but of “legal holidays” (which may differ a bit among our federal states). “Bank holiday” as a concept is not defined, over here. When Germans speak of “holidays” in general, they may have “legal holidays” in mind, but also holidays as defined by religious communities, which might not be “legal holidays” at all.