Example #1
0
    def holiday_anzac_day_observed(self):
        date = SmartDayArrow(self.year, 4, 25)

        if self.year > 2015 and date.weekday() in ['saturday', 'sunday']:
            return [
                Holiday(locale=self.locale,
                        region="",
                        date=date.shift_to_weekday('monday', including=True),
                        description="ANZAC Day (observed)",
                        flags="NV",
                        notes="")
            ]

        return []
Example #2
0
    def holiday_new_years_day_observed(self):
        date = SmartDayArrow(self.year, 1, 1)

        if date.weekday() in ['saturday', 'sunday']:
            return [
                Holiday(locale=self.locale,
                        region="",
                        date=date.shift_to_weekday('monday', including=True),
                        description="New Year's Day (observed)",
                        flags="NV",
                        notes="")
            ]

        return []
Example #3
0
    def holiday_koninkrijksdag(self):
        date = SmartDayArrow(self.year, 12, 15)

        if date.weekday() == 'sunday':
            date = date.shift(days=1)

        return [
            Holiday(locale=self.locale,
                    region="",
                    date=date,
                    description="Koninkrijksdag",
                    flags="NV",
                    notes="")
        ]
Example #4
0
    def holiday_buss_und_bettag(self):
        u"""11 days before 4. sunday before 12-25: [NRV] Buß- und Bettag"""

        return [
            Holiday(
                self.locale, "SN",
                SmartDayArrow(self.year, 12, 25).shift_to_weekday(
                    'sunday', order=4, reverse=True).shift(days=-11),
                "Buß- und Bettag", "NRV")
        ]
Example #5
0
    def holiday_after_new_years_day(self):
        date = SmartDayArrow(self.year, 1, 2)

        if date.weekday() in ['sunday', 'monday']:
            return [
                Holiday(locale=self.locale,
                        region="",
                        date=date.shift_to_weekday('tuesday', including=True),
                        description="Day after New Year's Day",
                        flags="NV",
                        notes="")
            ]

        elif date.weekday() == 'saturday':
            return [
                Holiday(locale=self.locale,
                        region="",
                        date=date.shift_to_weekday('monday', including=True),
                        description="Day after New Year's Day",
                        flags="NV",
                        notes="")
            ]

        return [
            Holiday(locale=self.locale,
                    region="",
                    date=date,
                    description="Day after New Year's Day",
                    flags="NV",
                    notes="")
        ]
Example #6
0
    def holiday_royal_jubilees(self):
        u"""2012-06-05: Queen's Diamond Jubilee"""
        if self.year == 2012:
            return [
                Holiday(locale=self.locale,
                        region="",
                        date=SmartDayArrow(2012, 6, 5),
                        description="Queen's Diamond Jubilee",
                        flags="NV",
                        notes="")
            ]

        return []
Example #7
0
    def holiday_reformationstag(self):
        u"""
        10 - 31: [NRF] Reformationstag

        before 2018: [BB, MV, SN, ST, TH]
        since 2018: [BB, BH, HH, MV, NI, SH, SN, ST, TH]
        2017: national holiday because of 500th anniversary
        """
        if self.year == 2017:
            regions = [""]
        elif self.year < 2018:
            regions = ["BB", "MV", "SN", "ST", "TH"]
        else:
            regions = ["BB", "BH", "HH", "MV", "NI", "SH", "SN", "ST", "TH"]

        return [
            Holiday(self.locale, region, SmartDayArrow(self.year, 10, 31),
                    "Reformationstag", "NRF") for region in regions
        ]
Example #8
0
    def holiday_spring_bank_holiday(self):
        u"""1. last monday in may: [NV] Spring Bank Holiday
        2012: Moved to June 4, because of Queen’s Diamond Jubilee
        """
        if self.year == 2012:
            date = SmartDayArrow(self.year, 6, 4)
        else:
            date = month_reference(self.year,
                                   "may",
                                   first=False) \
                .shift_to_weekday("monday",
                                  order=1,
                                  reverse=True,
                                  including=True)

        return [
            Holiday(locale=self.locale,
                    region="",
                    date=date,
                    description="Spring Bank Holiday",
                    flags="NV",
                    notes="")
        ]
Example #9
0
    def holiday_koningsdag(self):
        """04-27 or saturday before if it falls on sunday: [NF] Koninginnedag/Koningsdag """
        if self.year < 2014:
            date = SmartDayArrow(self.year, 4, 30)
            description = "Koninginnedag"
        else:
            date = SmartDayArrow(self.year, 4, 27)
            description = "Koningsdag"

        if date.weekday() == 'sunday':
            date = date.shift(days=-1)

        return [
            Holiday(locale=self.locale,
                    region="",
                    date=date,
                    description=description,
                    flags="NV",
                    notes="")
        ]
Example #10
0
    def holiday_christmas_day_observed(self):
        date = SmartDayArrow(self.year, 12, 25)

        if date.weekday() == 'sunday':
            return [
                Holiday(locale=self.locale,
                        region="",
                        date=date.shift_to_weekday('tuesday', including=True),
                        description="Christmas Day (observed)",
                        flags="NV",
                        notes="")
            ]

        elif date.weekday() == 'saturday':
            return [
                Holiday(locale=self.locale,
                        region="",
                        date=date.shift_to_weekday('monday', including=True),
                        description="Christmas Day (observed)",
                        flags="NV",
                        notes="")
            ]

        return []
Example #11
0
 def _date_from_fixed_reference(self, m):
     return SmartDayArrow(self.year, int(m.group('month')),
                          int(m.group('day')))