batoulapps / adhan-js

High precision Islamic prayer time library for JavaScript
MIT License
378 stars 86 forks source link

Malaysia & Indonesia Prayer Times #62

Closed farisfaisalthena closed 3 years ago

farisfaisalthena commented 3 years ago

Hi there,

I was just curious is there any calculations method for JAKIM? Because I tried using

    const coordinates = new adhan.Coordinates(2.926361, 101.696445);
    const date = new Date();
    const params = adhan.CalculationMethod.UmmAlQura();
    const time = new adhan.PrayerTimes(coordinates, date, params);

But i always get a few minutes earlier/later. Besides that I would also like to know what calculations are used for Malaysia and Indonesia. Thank you

sgtsquiggs commented 3 years ago

Was looking at this - I can't reconcile our code with what JAKIM is calculating. The fajr, isha offsets should be 20, 18 (Singapore calc method does this) but there's something else as well that I'm missing.

Going by the most official prayer times I could find: https://muftiwp.gov.my/images/falak/takwim/jadual-waktu-solat/KL-dan-Putrajaya/Jadual-Waktu-Solat-WPKL-PTJ-2021.pdf

I'll have to dig a bit more.

farisfaisalthena commented 3 years ago

Hello there,

So i believe there’s an issue right? Also the same with Indonesia praying time not being accurate

z3bi commented 3 years ago

@farisfaisalthena using the singapore method in the library will get you pretty close, we are working on adding a JAKIM method soon inshAllah that should match the times exactly.

farisfaisalthena commented 3 years ago

Hi, thank you for answering. I will just wait until JAKIM is added as my users might complain not being accurate etc. Also would be great if you could add "Sihat/Kemenag" calculation method for Indonesia, would highly appreciate that. For JAKIM here are some sites i found that might help you with the implementation https://khaliqhalid.my/2018/02/malaysia-muslim-praying-time-api/ and https://github.com/afzafri/Waktu-Solat-API. Great job so far and stay safe!

z3bi commented 3 years ago

@farisfaisalthena upon further investigation the reason our singapore method has a discrepancy is because the official times in Malaysia are centralized in different zones. If you use the coordinates provided in this document you will find that our times are only off by about 1 minute (which is most likely due to rounding - something we hope to fix in #43) https://www.e-solat.gov.my/portalassets/files/Lampiran%20B.pdf

farisfaisalthena commented 3 years ago

Yup there just off but would be great in future to have JAKIM calculation to provide a more accurate info 👍