|
| 1 | +# holidays |
| 2 | +# -------- |
| 3 | +# A fast, efficient Python library for generating country, province and state |
| 4 | +# specific sets of holidays on the fly. It aims to make determining whether a |
| 5 | +# specific date is a holiday as fast and flexible as possible. |
| 6 | +# |
| 7 | +# Authors: Vacanza Team and individual contributors (see CONTRIBUTORS file) |
| 8 | +# dr-prodigy <[email protected]> (c) 2017-2023 |
| 9 | +# ryanss <[email protected]> (c) 2014-2017 |
| 10 | +# Website: https://github.com/vacanza/holidays |
| 11 | +# License: MIT (see LICENSE file) |
| 12 | + |
| 13 | +from gettext import gettext as tr |
| 14 | + |
| 15 | +from holidays.calendars.julian import JULIAN_CALENDAR |
| 16 | +from holidays.groups import ChristianHolidays, InternationalHolidays, IslamicHolidays |
| 17 | +from holidays.holiday_base import HolidayBase |
| 18 | + |
| 19 | + |
| 20 | +class Kosovo(HolidayBase, ChristianHolidays, InternationalHolidays, IslamicHolidays): |
| 21 | + """Kosovo holidays. |
| 22 | +
|
| 23 | + References: |
| 24 | + * <https://bqk-kos.org/kalendari-i-festave/> |
| 25 | + * Law No. 03/L-064 on Public Holidays in the Republic of Kosovo. |
| 26 | + """ |
| 27 | + |
| 28 | + country = "XK" |
| 29 | + default_language = "sq" |
| 30 | + # %s (estimated). |
| 31 | + estimated_label = tr("%s (e vlerësuar)") |
| 32 | + supported_languages = ("en_US", "sq", "sr") |
| 33 | + # Independence declared on 2008-02-17. |
| 34 | + start_year = 2008 |
| 35 | + |
| 36 | + def __init__(self, *args, islamic_show_estimated: bool = True, **kwargs): |
| 37 | + """ |
| 38 | + Args: |
| 39 | + islamic_show_estimated: |
| 40 | + Whether to add "estimated" label to Islamic holidays name |
| 41 | + if holiday date is estimated. |
| 42 | + """ |
| 43 | + ChristianHolidays.__init__(self) |
| 44 | + InternationalHolidays.__init__(self) |
| 45 | + IslamicHolidays.__init__(self, show_estimated=islamic_show_estimated) |
| 46 | + super().__init__(*args, **kwargs) |
| 47 | + |
| 48 | + def _populate_public_holidays(self): |
| 49 | + # New Year's Day. |
| 50 | + name = tr("Viti i Ri") |
| 51 | + self._add_new_years_day(name) |
| 52 | + self._add_new_years_day_two(name) |
| 53 | + |
| 54 | + # Orthodox Christmas Day. |
| 55 | + self._add_christmas_day(tr("Krishtlindjet Ortodokse"), JULIAN_CALENDAR) |
| 56 | + |
| 57 | + # Independence Day. |
| 58 | + self._add_holiday_feb_17(tr("Dita e Pavarësisë së Republikës së Kosovës")) |
| 59 | + |
| 60 | + # Constitution Day. |
| 61 | + self._add_holiday_apr_9(tr("Dita e Kushtetutës së Republikës së Kosovës")) |
| 62 | + |
| 63 | + # International Workers' Day. |
| 64 | + self._add_labor_day(tr("Dita Ndërkombëtare e Punës")) |
| 65 | + |
| 66 | + # Europe Day. |
| 67 | + self._add_europe_day(tr("Dita e Evropës")) |
| 68 | + |
| 69 | + # Catholic Easter. |
| 70 | + name = tr("Pashkët Katolike") |
| 71 | + self._add_easter_sunday(name) |
| 72 | + self._add_easter_monday(name) |
| 73 | + |
| 74 | + # Orthodox Easter. |
| 75 | + name = tr("Pashkët Ortodokse") |
| 76 | + self._add_easter_sunday(name, JULIAN_CALENDAR) |
| 77 | + self._add_easter_monday(name, JULIAN_CALENDAR) |
| 78 | + |
| 79 | + # Eid al-Fitr. |
| 80 | + self._add_eid_al_fitr_day(tr("Bajrami i Madh, dita e parë")) |
| 81 | + |
| 82 | + # Eid al-Adha. |
| 83 | + self._add_eid_al_adha_day(tr("Bajrami i Vogël, dita e parë")) |
| 84 | + |
| 85 | + # Catholic Christmas Day. |
| 86 | + self._add_christmas_day(tr("Krishtlindjet Katolike")) |
| 87 | + |
| 88 | + |
| 89 | +class XK(Kosovo): |
| 90 | + pass |
| 91 | + |
| 92 | + |
| 93 | +class XKK(Kosovo): |
| 94 | + pass |
0 commit comments