File: turkey.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 (35 lines) | stat: -rw-r--r-- 1,083 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
33
34
35
from datetime import timedelta
from ..core import IslamicCalendar, SAT, SUN
from ..registry_tools import iso_register


@iso_register('TR')
class Turkey(IslamicCalendar):
    'Turkey'
    include_new_years_day = True
    shift_new_years_day = False
    # Even though they're using an islamic calendar, the work week is MON->FRI
    WEEKEND_DAYS = (SAT, SUN)

    # Islamic Holidays
    include_eid_al_fitr = True
    length_eid_al_fitr = 3
    include_eid_al_adha = True
    length_eid_al_adha = 4

    # Civil holidays
    include_labour_day = True
    labour_day_label = "Labor and Solidarity Day"
    FIXED_HOLIDAYS = IslamicCalendar.FIXED_HOLIDAYS + (
        (4, 23, "National Sovereignty and Children's Day"),
        (5, 19, "Commemoration of Atatürk, Youth and Sports Day"),
        (7, 15, "Democracy and National Unity Day"),
        (8, 30, "Victory Day"),
        (10, 29, "Republic Day"),
    )

    def get_delta_islamic_holidays(self, year):
        """
        Turkey Islamic holidays are shifted by one day every year.
        """
        return timedelta(days=-1)