canbax / namaz-vakti-api

Vakit verilerini hesaplar. Calculates the Islamic prayer times
https://vakit.vercel.app/
MIT License
57 stars 17 forks source link

Timezone & others #9

Closed lasharor closed 1 year ago

lasharor commented 1 year ago

Thanks for this API;

suggesting following improvements;

displaying times according to local timezone. When accessing times for EU countries the times are +2 compared to local timezone

I have found a difference in time for yatsi compared to official website:

https://namaz-vakti.vercel.app/api/timesFromPlace?country=Netherlands&region=Noord-Brabant&city=Eindhoven&days=1

shows {"place":{"country":"Netherlands","countryCode":"NL","city":"Eindhoven","region":"Noord-Brabant","latitude":51.44083,"longitude":5.47778},"times":{"2022-12-11":["08:30","10:26","14:36","16:16","18:36","20:26"]}}

compared to:

Screenshot 2022-12-11 at 18 58 29
canbax commented 1 year ago

wow! Thanks for the quick feedback. Actually I will show all times according to UTC timezone. There is a timezoneOffset parameter. Currently it is set to 180 which is for Turkey but I will make it 0 and show all times on UTC by default.

Regarding yatsi time, I'm using adhan-js library for calculations. In future, I plan to fork it and create my own version but I not in near future :) So for now, I cannot do anything. You are welcome to check adhan-js library and maybe create a pull request for this issue.

canbax commented 1 year ago

I updated the default timezoneOffset to 0. To see the correct times. It would help if you used it like

https://namaz-vakti.vercel.app/api/timesFromPlace?country=Netherlands&region=Noord-Brabant&city=Eindhoven&days=1&timezoneOffset=60

canbax commented 1 year ago

I investigated this more and now I think Diyanet might calculate times wrongly! Screenshot_20221224_130438_Brave from 31/2022 to 01/2023 there is a 24 minutes difference in Isya time!. That seems pretty abnormal for me.

Please feel free to open the issue again if you think we can calculate better.

lasharor commented 1 year ago

FYI, when using:

https://ezanvakti.herokuapp.com/vakitler/13978

The yatsi times are displayed correctly. I have since moved to this API.

canbax commented 1 year ago

I recommend not using it. I think diyanet is wrong. https://twitter.com/canbax18/status/1606601403203555330?t=isZaMqfFO-zc4TxrqewsJA&s=19

lasharor commented 1 year ago

I think the diyanet time change may be related to: https://diyanet.nl/avrupada-islami-kuruluslar-takvim-birlikteligini-sagladi/