示例#1
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="")
        ]
示例#2
0
    def holiday_boxing_day_observed(self):
        date = SmartDayArrow(self.year, 12, 26)

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

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

        return []
示例#3
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 []
示例#4
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 []