-
-
Notifications
You must be signed in to change notification settings - Fork 175
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Turkey - Eid al-Fitr First wrong date #611
Comments
please take note of the information WebApi V1 and V2 deprecated |
This is wrong in WebApi V3 too for all three days.
|
Where can I find out the exact date for Ramadan? It is set every year by a church leader. Is there a government source here? |
As far as I understand it, it is roughly based on a lunar calendar but it depends on when the cresent moon is actually visible/seen so it's a tentative date until just a few days before the actual date when it will be announced to the public, but who announces it varies from country to country and not all countries might have it start on the exact same date. |
I am aware of that. But where do I get the real date? And does the date only apply to Turkey or also to other countries? |
It's different for each country. For turkey it seems to be Directorate of Religious Affairs also known as Diyanet. From the articels I've found it seems they announced it on Instagram??? Unfortunately I don't speak the language so I couldn't verify that. |
Maybe for V4 these kinds of holidays need a marker for tentative dates that might still change. I just noticed that your calculation for the tentative date you supply seems to be off by 1 year. |
There is another issue that might not exactly belong in this report but it is related. Some holidays in Turkey start half a day early at 13:00 like Eid al-Fitr First, so this might be a marker in V4 too or half day support. |
I have temporarily deactivated the faulty holidays. Until there is a sensible solution for the future. |
Thank you for the quick update. I think tentative dates would be fine if marked as such in the name for example but there is a general issue with the calculation. I've checked the code and found that the calculation of the hijri year in the TurkeyHolidayProvider is the source of half the problem. The problem is calculating the hijri year requires the full gregorian date as the years have different lengths and are not aligned so in 2024 there is 1445 during roughly the first half of 2024 and 1446 for the second half. So the holidays that depend on it are currently returned wrongly for next year this affects not just Ramadan but also the days of Eid al-Adha (Feast Of Sacrifice) Holidays. |
According to Wikipedia one single Gregorian year can match with three Hijri years. So my solution is returning multiple Hijri years instead of one Hijri year (calculated Hijri year, minus 1, and plus 1.)
Then calculate multiple holidays according to multiple Hijri years and just select the dates which has correct year.
Also in one Gregorian year, 2000 for example, multiple Ramadan holidays can exist. This solution also covers this case. |
I want to update my previous
EDIT : One Gregorian year may match with three Hijri years, but third year maps just the beginning of the Hijri year which contains no Ramadan Holiday. So only taking only two Hijri years is enough. Below code may be more performant than calculating min-max Hijri year.
|
Affected country
Türkiye
Affected public holiday
Eid al-Fitr First
Source of the information
https://tr.wikipedia.org/wiki/Ramazan_Bayram%C4%B1
More information
https://date.nager.at/Api/v2/PublicHolidays/2024/TR
2024.03.30 instead of 2024.04.10
The text was updated successfully, but these errors were encountered: