iamriajul / adhan-dart

Adhan for Dart / Muslim Prayer Times Library. Now retrieving Prayer time in Dart easier than ever.
https://pub.dev/packages/adhan
MIT License
86 stars 41 forks source link

Issue in the asr at Calculation Method.turkey #47

Closed burhanaksendir closed 1 year ago

burhanaksendir commented 1 year ago

At the address below, the Diyanet's prayer times for Istanbul are shown: https://namazvakitleri.diyanet.gov.tr/en-US/9541/prayer-time-for-istanbul

All prayer times are calculated correctly. But the asr is wrong. How can I solve this problem?

Here is the code I use to get Prayer Times:

print('My Prayer Times');
    final myCoordinates = Coordinates(41.015137, 28.979530); // Istanbul
    final params = CalculationMethod.turkey.getParameters();
    params.madhab = Madhab.hanafi;

    final prayerTimes = PrayerTimes.today(myCoordinates, params);

    print(
        "---Today's Prayer Times in Your Local Timezone(${prayerTimes.fajr.timeZoneName})---");
    print(DateFormat.jm().format(prayerTimes.fajr));
    print(DateFormat.jm().format(prayerTimes.sunrise));
    print(DateFormat.jm().format(prayerTimes.dhuhr));
    print(DateFormat.jm().format(prayerTimes.asr)); // -> Asr time is calculated incorrectly
    print(DateFormat.jm().format(prayerTimes.maghrib));
    print(DateFormat.jm().format(prayerTimes.isha));

    print('---');
sinanhaci commented 1 year ago

Did you solve the problem?

burhanaksendir commented 1 year ago

Yes. You just need to change this line: params.madhab = Madhab.shafi;