How to use the workalendar.europe.switzerland.Switzerland function in workalendar

To help you get started, we’ve selected a few workalendar examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github peopledoc / workalendar / workalendar / europe / switzerland.py View on Github external
include_berchtolds_day = True
    include_labour_day = True
    include_corpus_christi = True
    include_assumption = True
    include_all_saints = True
    include_immaculate_conception = True


@iso_register('CH-GE')
class Geneva(Switzerland):
    'Geneva'

    include_boxing_day = False

    FIXED_HOLIDAYS = Switzerland.FIXED_HOLIDAYS + (
        (12, 31, "Creation of Geneva Republic"),
    )

    def get_genevan_fast(self, year):
        "Thursday following the first Sunday of September"
        first_sunday = self.get_nth_weekday_in_month(year, 9, SUN)
        # The following thursday is 4 days after
        return (
            first_sunday + timedelta(days=4),
            "Genevan Fast"
        )

    def get_variable_days(self, year):
        days = super().get_variable_days(year)
        days.append(self.get_genevan_fast(year))
        return days
github peopledoc / workalendar / workalendar / europe / switzerland.py View on Github external
include_corpus_christi = True
    include_assumption = True
    include_all_saints = True
    include_immaculate_conception = True


@iso_register('CH-TG')
class Thurgau(Switzerland):
    'Thurgau'

    include_berchtolds_day = True
    include_labour_day = True


@iso_register('CH-TI')
class Ticino(Switzerland):
    'Ticino'

    include_good_friday = False
    include_epiphany = True
    include_st_josephs_day = True
    include_labour_day = True
    include_corpus_christi = True
    include_assumption = True
    include_all_saints = True
    include_immaculate_conception = True

    FIXED_HOLIDAYS = Switzerland.FIXED_HOLIDAYS + (
        (6, 29, "Saints Peter and Paul"),
    )
github peopledoc / workalendar / workalendar / europe / switzerland.py View on Github external
class Obwalden(Switzerland):
    'Obwalden'

    include_berchtolds_day = True
    include_corpus_christi = True
    include_assumption = True
    include_all_saints = True
    include_immaculate_conception = True

    FIXED_HOLIDAYS = Switzerland.FIXED_HOLIDAYS + (
        (9, 25, "Saint Nicholas of Flüe Day"),
    )


@iso_register('CH-SG')
class StGallen(Switzerland):
    'St. Gallen'

    include_all_saints = True


@iso_register('CH-SH')
class Schaffhausen(Switzerland):
    'Schaffhausen'

    include_berchtolds_day = True
    include_labour_day = True


@iso_register('CH-SO')
class Solothurn(Switzerland):
    'Solothurn'
github peopledoc / workalendar / workalendar / europe / switzerland.py View on Github external
class StGallen(Switzerland):
    'St. Gallen'

    include_all_saints = True


@iso_register('CH-SH')
class Schaffhausen(Switzerland):
    'Schaffhausen'

    include_berchtolds_day = True
    include_labour_day = True


@iso_register('CH-SO')
class Solothurn(Switzerland):
    'Solothurn'

    include_berchtolds_day = True
    include_st_josephs_day = True
    include_labour_day = True
    include_corpus_christi = True
    include_assumption = True
    include_all_saints = True
    include_immaculate_conception = True


@iso_register('CH-SZ')
class Schwyz(Switzerland):
    'Schwyz'

    include_epiphany = True
github peopledoc / workalendar / workalendar / europe / switzerland.py View on Github external
@iso_register('CH-SZ')
class Schwyz(Switzerland):
    'Schwyz'

    include_epiphany = True
    include_st_josephs_day = True
    include_corpus_christi = True
    include_assumption = True
    include_all_saints = True
    include_immaculate_conception = True


@iso_register('CH-TG')
class Thurgau(Switzerland):
    'Thurgau'

    include_berchtolds_day = True
    include_labour_day = True


@iso_register('CH-TI')
class Ticino(Switzerland):
    'Ticino'

    include_good_friday = False
    include_epiphany = True
    include_st_josephs_day = True
    include_labour_day = True
    include_corpus_christi = True
    include_assumption = True
github peopledoc / workalendar / workalendar / europe / switzerland.py View on Github external
include_corpus_christi = True
    include_assumption = True
    include_all_saints = True
    include_immaculate_conception = True


@iso_register('CH-AR')
class AppenzellAusserrhoden(Switzerland):
    'Appenzell Ausserrhoden'

    include_labour_day = True


@iso_register('CH-BE')
class Bern(Switzerland):
    'Bern'

    include_berchtolds_day = True


@iso_register('CH-BL')
class BaselLandschaft(Switzerland):
    'Basel-Landschaft'

    include_labour_day = True


@iso_register('CH-BS')
class BaselStadt(Switzerland):
    'Basel-Stadt'
github peopledoc / workalendar / workalendar / europe / switzerland.py View on Github external
days.append((date(year, 3, 19), "St Joseph's Day"))
        return days


@iso_register('CH-AG')
class Aargau(Switzerland):
    'Aargau'

    include_berchtolds_day = True
    include_corpus_christi = True
    include_all_saints = True
    include_immaculate_conception = True


@iso_register('CH-AI')
class AppenzellInnerrhoden(Switzerland):
    'Appenzell Innerrhoden'

    include_corpus_christi = True
    include_assumption = True
    include_all_saints = True
    include_immaculate_conception = True


@iso_register('CH-AR')
class AppenzellAusserrhoden(Switzerland):
    'Appenzell Ausserrhoden'

    include_labour_day = True


@iso_register('CH-BE')
github peopledoc / workalendar / workalendar / europe / switzerland.py View on Github external
FIXED_HOLIDAYS = WesternCalendar.FIXED_HOLIDAYS + (
        (8, 1, "National Holiday"),
    )

    def get_variable_days(self, year):
        days = super().get_variable_days(year)
        if self.include_berchtolds_day:
            days.append((date(year, 1, 2), "Berchtold's Day"))
        if self.include_st_josephs_day:
            days.append((date(year, 3, 19), "St Joseph's Day"))
        return days


@iso_register('CH-AG')
class Aargau(Switzerland):
    'Aargau'

    include_berchtolds_day = True
    include_corpus_christi = True
    include_all_saints = True
    include_immaculate_conception = True


@iso_register('CH-AI')
class AppenzellInnerrhoden(Switzerland):
    'Appenzell Innerrhoden'

    include_corpus_christi = True
    include_assumption = True
    include_all_saints = True
    include_immaculate_conception = True
github peopledoc / workalendar / workalendar / europe / switzerland.py View on Github external
@iso_register('CH-UR')
class Uri(Switzerland):
    'Uri'

    include_epiphany = True
    include_st_josephs_day = True
    include_corpus_christi = True
    include_assumption = True
    include_all_saints = True
    include_immaculate_conception = True


@iso_register('CH-VD')
class Vaud(Switzerland):
    'Vaud'

    include_berchtolds_day = True
    include_boxing_day = False

    def get_federal_thanksgiving_monday(self, year):
        "Monday following the 3rd sunday of September"
        third_sunday = self.get_nth_weekday_in_month(year, 9, SUN, 3)
        return (
            third_sunday + timedelta(days=1),
            "Federal Thanksgiving Monday"
        )

    def get_variable_days(self, year):
        days = super().get_variable_days(year)
        days.append(self.get_federal_thanksgiving_monday(year))
github peopledoc / workalendar / workalendar / europe / switzerland.py View on Github external
@iso_register('CH-AR')
class AppenzellAusserrhoden(Switzerland):
    'Appenzell Ausserrhoden'

    include_labour_day = True


@iso_register('CH-BE')
class Bern(Switzerland):
    'Bern'

    include_berchtolds_day = True


@iso_register('CH-BL')
class BaselLandschaft(Switzerland):
    'Basel-Landschaft'

    include_labour_day = True


@iso_register('CH-BS')
class BaselStadt(Switzerland):
    'Basel-Stadt'

    include_labour_day = True


@iso_register('CH-FR')
class Fribourg(Switzerland):
    'Fribourg'