GothenburgBitFactory / holidata

Holidata is the core of holidata.net, a no-nonsense, ad-free provider of international holiday data.
https://holidata.net
MIT License
43 stars 11 forks source link

Add locale for Turkish-Turkey tr-TR #60

Closed farukara closed 3 years ago

farukara commented 3 years ago

Basic information for Turkey Language Code: tr Country Code: TR

2020

Holidays with fixed dates (All are national except new year and Labor day, however Labor day is still fixed):

Jan 1 - New Year Apr 23 - National Independence Day May 1 - Labor Day May 19 - Ataturk Memorial, Youth and Sports Day Jul 15 - Democracy Day Aug 30 - Victory Day Oct 29 - Republic Day

Holidays with variable dates (mainly because they depend on a different calendar). Each year both holidays move 10 days earlier than previous year, but I'm not sure if that's a fixed value (10 days):

May 24 - May 26 Ramadan Holiday (3 days) - globally known as "Eid ul Fitr" Jul 31 - Aug 3 Kurban Holiday (4 days) - globally known as "Eid al-Adha"

2021

Fixed dates do not change

Variable dates: May 13 - May 15 Ramadan Holiday (3 days) - known globally as "Eid ul Fitr" Jul 19 - Jul 23 Kurban Holiday (4 days) - known globally as "Eid al-Adha"

Official website for 2021 (you can find other years as well): https://www2.diyanet.gov.tr/DinHizmetleriGenelMudurlugu/Sayfalar/2021YılıResmiTatilGünleri.aspx

lauft commented 3 years ago

@farukara thanks for adding this. I have drafted a locale from the data you provided, which we can flesh out:

class tr_TR(Locale):
    """
    01-01: [NF] Yılbaşı # New Year
    04-23: [NF] Ulusal Egemenlik ve Çocuk Bayramı  # National Independence Day
    05-01: [NF] Emek ve Dayanışma Günü # Labor Day
    05-19: [NF] Atatürk'ü Anma Gençlik ve Spor Bayramı # Ataturk Memorial, Youth and Sports Day
    07-15: [NF] DEMOKRASİ VE MİLLİ BİRLİK GÜNÜ # Democracy Day
    08-30: [NF] Zafer Bayramı # Victory Day
    10-29: [NF] Cumhuriyet Bayramı # Republic Day
    : [NRV] Ramazan Bayramı 1
    : [NRV] Ramazan Bayramı 2
    : [NRV] Ramazan Bayramı 3
    : [NRV] Kurban Bayramı 1
    : [NRV] Kurban Bayramı 2
    : [NRV] Kurban Bayramı 3
    : [NRV] Kurban Bayramı 4
    """

    locale = "tr-TR"

Here are my open issues:

farukara commented 3 years ago

Looks like almost ready to ship to me. Nice work. Here are some answers to your questions:

Hope that helps. If you still have questions let me know. Cheers.

lauft commented 3 years ago

First, I meant new year and labor day are observed internationally...

Your assumptions are correct. Holidata treats each country individually, so there are no international holidays. Regions are those defined by ISO_3166-2.

Religious holidays are based on lunar calendar and it's pretty lunatic...

That fact was already clear to me. My question was wether at least the relative distance between Ramazan Bayramı and Kurban Bayramı is fixed. If this is the case, we only need to define a single reference date per year which would simplify the procedure.

... Here is another link which is a little bit easier to digest. ...

The suggested PDF does not contain Democracy Day... 😳

... So I would suggest skip them altogether...

Agreed. The half-holidays are dropped for now

If I researched it correctly (https://www.takvim.com/2011_takvimi.html - no official source, I guess...), in 2011 Zafer Bayramı and Ramazan Bayramı (1. Gün) fell on the same day, 2011-08-30. Is there a special handling for such a case?

lauft commented 3 years ago

I have compiled everything so far into a PR to review: https://github.com/GothenburgBitFactory/holidata/pull/61

farukara commented 3 years ago

Is there a special handling for such a case?

There is no special handling when 2 holidays coincide. The rule of the longest applies. Even if they are right back to back then again both will be holidays. So, it will be longest possible :)

I checked the PR, looks good to me. Nice job.

lauft commented 3 years ago

PR is merged and holidata.net provides the new locale tr-TR. Thanks @farukara for your contribution. It would be nice if I can count on you to keep an eye on further developments of the locale. Do you know when the new dates for the religious holidays are announced?

farukara commented 3 years ago

Sure just keep in touch.

Normally, they know future 5-6 years of religious holidays in advance but they refrain to announce up until 2-3 years. The reason being the unstable cycles of the moon.