Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
from ..core import WesternCalendar
class EuropeanCentralBank(WesternCalendar):
"European Central Bank"
# Civil holidays
include_labour_day = True
FIXED_HOLIDAYS = WesternCalendar.FIXED_HOLIDAYS + (
(12, 26, "St. Stephen's Day"),
)
# Christian holidays
include_good_friday = True
include_easter_monday = True
@iso_register('EE')
class Estonia(WesternCalendar):
'Estonia'
include_good_friday = True
include_easter_sunday = True
include_whit_sunday = True
whit_sunday_label = 'Nelipühade 1. püha'
include_christmas_eve = True
include_christmas = True
include_boxing_day = True
boxing_day_label = "Teine jõulupüha"
FIXED_HOLIDAYS = WesternCalendar.FIXED_HOLIDAYS + (
(2, 24, "Independence Day"),
(5, 1, "Kevadpüha"),
(6, 23, "Võidupüha"),
(6, 24, "Jaanipäev"),
(8, 20, "Taasiseseisvumispäev")
)
from datetime import date, timedelta
from ..core import WesternCalendar, MON, SAT, SUN
from ..registry_tools import iso_register
@iso_register("NZ")
class NewZealand(WesternCalendar):
"New Zealand"
include_good_friday = True
include_easter_monday = True
include_boxing_day = True
FIXED_HOLIDAYS = WesternCalendar.FIXED_HOLIDAYS + (
(1, 2, "Day after New Year's Day"),
(2, 6, "Waitangi Day"),
(4, 25, "ANZAC Day")
)
def get_queens_birthday(self, year):
return (
NewZealand.get_nth_weekday_in_month(year, 6, MON, 1),
"Queen's Birthday"
)
def get_labour_day(self, year):
return (
NewZealand.get_nth_weekday_in_month(year, 10, MON, 4),
"Labour Day"
)
from ..core import WesternCalendar
from ..registry_tools import iso_register
@iso_register('AT')
class Austria(WesternCalendar):
'Austria'
FIXED_HOLIDAYS = WesternCalendar.FIXED_HOLIDAYS + (
(10, 26, "National Holiday"), # Nationalfeiertag
)
# Civil holidays
include_labour_day = True
labour_day_label = "State Holiday" # Staatsfeiertag
# Christian holidays
include_epiphany = True
include_easter_monday = True
include_ascension = True
include_whit_monday = True
include_corpus_christi = True
include_assumption = True
include_all_saints = True
include_immaculate_conception = True
include_christmas = True
include_boxing_day = True
@iso_register('LU')
class Luxembourg(WesternCalendar):
'Luxembourg'
# Christian holidays
include_easter_monday = True
include_ascension = True
include_whit_monday = True
include_all_saints = True
include_assumption = True
include_boxing_day = True
# Civil holidays
include_labour_day = True
FIXED_HOLIDAYS = WesternCalendar.FIXED_HOLIDAYS + (
(6, 23, "Luxembourg National Holiday"),
)
def get_fixed_holidays(self, year):
days = super().get_fixed_holidays(year)
if year > 2018:
days.append((date(year, 5, 9), "Europe Day"))
return days
from datetime import timedelta, date
from ..core import WesternCalendar, MON, SAT, SUN
from ..registry_tools import iso_register
@iso_register('BR')
class Brazil(WesternCalendar):
"Brazil"
FIXED_HOLIDAYS = WesternCalendar.FIXED_HOLIDAYS + (
(4, 21, "Tiradentes' Day"),
(9, 7, "Independence Day"),
(10, 12, "Our Lady of Aparecida"),
(11, 2, "All Souls' Day"),
(11, 15, "Republic Day"),
)
include_sao_jose = False
sao_jose_label = "São José"
include_sao_pedro = False
sao_pedro_label = "São Pedro"
include_sao_joao = False
sao_joao_label = "São João"
# Civil holidays
include_labour_day = True
include_servidor_publico = False
servidor_publico_label = "Dia do Servidor Público"
from ..registry_tools import iso_register
@iso_register('NL')
class Netherlands(WesternCalendar):
'Netherlands'
include_good_friday = True
include_easter_sunday = True
include_easter_monday = True
include_ascension = True
include_whit_sunday = True
include_whit_monday = True
include_boxing_day = True
FIXED_HOLIDAYS = WesternCalendar.FIXED_HOLIDAYS + (
(5, 5, "Liberation Day"),
)
def get_king_queen_day(self, year):
"""27 April unless this is a Sunday in which case it is the 26th
Before 2013 it was called Queensday, falling on
30 April, unless this is a Sunday in which case it is the 29th.
"""
if year > 2013:
king_day = date(year, 4, 27)
if king_day.weekday() != SUN:
return (king_day, "King's day")
return (king_day - timedelta(days=1), "King's day")
else:
queen_day = date(year, 4, 30)
from ..core import WesternCalendar
from ..registry_tools import iso_register
@iso_register('BE')
class Belgium(WesternCalendar):
'Belgium'
FIXED_HOLIDAYS = WesternCalendar.FIXED_HOLIDAYS + (
(7, 21, "National Day"),
(11, 11, "Armistice of 1918"),
)
# Civil holidays
include_labour_day = True
# Christian holidays
include_easter_monday = True
include_ascension = True
include_whit_monday = True
include_assumption = True
include_all_saints = True
from datetime import date, timedelta
from ..core import WesternCalendar
from ..registry_tools import iso_register
@iso_register('DE')
class Germany(WesternCalendar):
'Germany'
# Civil holidays
include_labour_day = True
FIXED_HOLIDAYS = WesternCalendar.FIXED_HOLIDAYS + (
(10, 3, "Day of German Unity"),
)
# Christian holidays
include_easter_monday = True
include_ascension = True
include_whit_monday = True
include_good_friday = True
include_boxing_day = True
boxing_day_label = "Second Christmas Day"
# True if including reformation day for all years
all_time_include_reformation_day = False
# True if including reformation day since 2018
include_reformation_day_2018 = False
# Christian holidays
include_epiphany = True
include_good_friday = True
include_easter_sunday = True
include_easter_monday = True
include_ascension = True
include_whit_sunday = True
whit_sunday_label = "Pentecost"
# Christmas Eve is not a holiday but not a work day either
include_christmas_eve = True
include_boxing_day = True
boxing_day_label = "Second Day of Christmas"
# Civil holidays
include_labour_day = True
FIXED_HOLIDAYS = WesternCalendar.FIXED_HOLIDAYS + (
(6, 6, "National Day"),
# New Year's Eve is not a holiday but not a work day either
(12, 31, "New Year's Eve")
)
# Midsummer Eve is not a holiday but not a work day either
def get_midsummer_eve(self, year):
date_eve = Sweden.get_nth_weekday_in_month(
year, 6, FRI, start=date(year, 6, 19))
return date_eve
def get_midsummer_day(self, year):
date_eve = Sweden.get_nth_weekday_in_month(
year, 6, SAT, start=date(year, 6, 20))
return date_eve