batoulapps / adhan-js

High precision Islamic prayer time library for JavaScript
MIT License
388 stars 87 forks source link

prayer times are not accurate #45

Closed natashajaved closed 3 years ago

natashajaved commented 3 years ago

There's difference of minutes in the prayer times I get using your library and other apps like Muslim Pro, Prayer times

z3bi commented 3 years ago

Can you provide the location, the parameters you're using, the times you're getting from the library, and the times you're comparing to.

natashajaved commented 3 years ago

Latitude is : 30.375321000000003 Longitude is :69.34511599999999

` var date = new Date(); var coordinates = new adhan.Coordinates(props.coords.latitude, props.coords.longitude); var params = adhan.CalculationMethod.MuslimWorldLeague(); params.madhab = adhan.Madhab.Shafi; var prayerTimes = new adhan.PrayerTimes(coordinates, date, params);

  var fajrTime = moment(prayerTimes.fajr).format('hh:mm');
  var sunriseTime = moment(prayerTimes.sunrise).tz('Asia/Karachi').format('hh:mm');
  var dhuhrTime = moment(prayerTimes.dhuhr).tz('Asia/Karachi').format('hh:mm A');
  var asrTime = moment(prayerTimes.asr).tz('Asia/Karachi').format('hh:mm A');
  var maghribTime = moment(prayerTimes.maghrib).tz('Asia/Karachi').format('hh:mm A');
  var ishaTime = moment(prayerTimes.isha).tz('Asia/Karachi').format('hh:mm A');`

Times from libraray: asrTime: "03:55 PM" dhuhrTime: "12:34 PM" fajrTime: "05:21" ishaTime: "07:41 PM" maghribTime: "06:26 PM" sunriseTime: "06:41"

Comparing Times from Muslim Pro: asrTime: "03:45 PM" dhuhrTime: "12:24 PM" fajrTime: "05:21" ishaTime: "07:38 PM" maghribTime: "06:16 PM" sunriseTime: "06:32"

@z3bi

ameirwillowtree commented 3 years ago

@natashajaved I cannot speak to the accuracy of the times of "Muslim Pro" but here are the times the library generates for Islamabad, Pakistan https://runkit.com/ameirwillowtree/60462295e15da2001b3275ce

and here are the exact same times published in the Pakistan newspaper Dawn https://www.dawn.com/prayers-timings

And if I enter your coordinates into another sunrise/sunset website I get the same times as the library https://sunrise-sunset.org/search?location=30.375321000000003%2C+69.34511599999999

So I'm not sure how Muslim Pro has "6:32" as the sunrise time or "6:16" as sunset/maghrib time, that is just incorrect.