Closed farukara closed 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:
DEMOKRASİ VE MİLLİ BİRLİK GÜNÜ
on the website you mentioned. Can you provide a capitalized version?RAMADAN HOLIDAY AREFES
(May 12) and Feast of Sacrifice
(July 19) or include them as whole days.Looks like almost ready to ship to me. Nice work. Here are some answers to your questions:
The capitalized version: Demokrasi ve Milli Birlik Günü
First, I meant new year and labor day are observed internationally, so you can't really say it's a national holiday, they are almost a global holiday I guess. I think, I initially misunderstand your national/regional labels. I thought of region as comprised of a couple of countries like Eastern Europe. But I guess you're referring to regions inside the country. If that's the case all holidays are national. Turkey don't have smaller regions with their own holidays. If I'm still getting it wrong please let me know. Second by saying "labor day is still fixed" I meant it's always 1st of May, no matter which day of the week it happens. I know in some other countries it's always sundays of some week, however that's not the case for Turkey. So that should be easy.
Religious holidays are based on lunar calendar and it's pretty lunatic if you ever had to worked with it. That's why I'm really not sure if you can extract a mathematical rule out of it. You would be pretty famous I should say if you can. I guess best bet would be to set the variable holidays manually each year. To make the matter worse, the difference is not always 10 days each year, it really randomly changes between 9-12 days or so. I told you, you would pull your hair if you want to implement an algorithm. I found a python module however, which deals with that calendar but I haven't had a chance to give it a try yet. Here is the module if you want to check out yourself.
You can easily see previous years by changing the year in the URL. But it only goes back to 2014. Here is another link which is a little bit easier to digest. Notice Democracy Day, the holiday we mentioned in the first item, is started to be observed on 2017 and later.
I'm not a fan of half day holidays. That's why I didn't even mentioned that at my first message. Furthermore, most of the time it's only half day off for government jobs, not the private sector. So I would suggest skip them altogether. If that's the route you want to take, then you can ignore Arefe
days for both religious holidays.
Hope that helps. If you still have questions let me know. Cheers.
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?
I have compiled everything so far into a PR to review: https://github.com/GothenburgBitFactory/holidata/pull/61
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.
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?
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.
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