File: denmark.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 (32 lines) | stat: -rw-r--r-- 1,020 bytes parent folder | download
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
from datetime import timedelta
from ..core import WesternCalendar
from ..registry_tools import iso_register


@iso_register('DK')
class Denmark(WesternCalendar):
    'Denmark'

    include_holy_thursday = True
    include_good_friday = True
    include_easter_sunday = True
    include_easter_monday = True
    include_ascension = True
    include_whit_sunday = True
    whit_sunday_label = "Pentecost Sunday"
    include_whit_monday = True
    whit_monday_label = "Pentecost Monday"
    include_boxing_day = True
    boxing_day_label = "Second Day of Christmas"
    include_christmas_eve = True

    def get_store_bededag(self, year):  # 'great prayer day'
        easter_sunday = self.get_easter_sunday(year)
        return easter_sunday + timedelta(days=26)

    def get_variable_days(self, year):
        days = super().get_variable_days(year)
        # Great prayer day is a working day since 2024
        if year < 2024:
            days.append((self.get_store_bededag(year), "Store Bededag"))
        return days