File: croatia.py

package info (click to toggle)
python-calendra 7.11.1-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,600 kB
  • sloc: python: 16,840; makefile: 6
file content (48 lines) | stat: -rw-r--r-- 1,404 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
from datetime import date

from ..core import WesternCalendar
from ..registry_tools import iso_register


@iso_register('HR')
class Croatia(WesternCalendar):
    'Croatia'

    FIXED_HOLIDAYS = WesternCalendar.FIXED_HOLIDAYS + (
        (6, 22, "Anti-Fascist Struggle Day"),
        (8, 5, "Victory & Homeland Thanksgiving & Day of Croatian defenders"),
    )

    # Civil holidays
    include_labour_day = True
    labour_day_label = "International Workers' Day"

    # Christian holidays
    include_epiphany = True
    include_easter_sunday = True
    include_easter_monday = True
    include_corpus_christi = True
    include_assumption = True
    include_all_saints = True
    include_christmas = True
    include_boxing_day = True
    boxing_day_label = "St. Stephen's Day"

    def get_fixed_holidays(self, year):
        days = super().get_fixed_holidays(year)

        if year >= 2020:
            days.extend([
                # Statehood date has changed in 2020
                (date(year, 5, 30), "Statehood Day"),
                # Remembrance Day has been added in 2020
                (date(year, 11, 18), "Remembrance Day"),
            ])
        else:
            days.extend([
                (date(year, 6, 25), "Statehood Day"),
                # Independance day was a holiday until 2020
                (date(year, 10, 8), "Independence Day"),
            ])

        return days