Skip to content
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

Next Prayer by Time Nor Working #32

Open
wael93 opened this issue Sep 26, 2021 · 0 comments
Open

Next Prayer by Time Nor Working #32

wael93 opened this issue Sep 26, 2021 · 0 comments
Labels
bug Something isn't working

Comments

@wael93
Copy link

wael93 commented Sep 26, 2021

I have this code

  final myCoordinates = Coordinates(21.416667938232425, 39.81666564941406); // Replace with
    final MaccaTime = Duration(hours: 3);
    final date = DateComponents.from(DateTime.now());


    final params = CalculationMethod.umm_al_qura.getParameters();
    params.madhab = Madhab.hanafi;
    params.adjustments.fajr = -1;
    final prayerTimes =PrayerTimes(myCoordinates, date, params, utcOffset: MaccaTime);
   
    var nextPrayerTimes = prayerTimes.nextPrayer();
    print("nextPrayerTimes "+ nextPrayerTimes.toString() );

    final nextPrayerTime = prayerTimes.timeForPrayer(nextPrayerTimes);

  
    final startTime = DateTime(nextPrayerTime.year, nextPrayerTime.month,
        nextPrayerTime.day,
        nextPrayerTime.hour,
        nextPrayerTime.minute);
    final currentTime = DateTime.now();

    final diff_dy = startTime.difference(currentTime).inDays;
    final diff_hr = startTime.difference(currentTime).inHours;
    final diff_mn = startTime.difference(currentTime).inMinutes;
    final diff_sc = startTime.difference(currentTime).inSeconds;

    print(diff_dy);
    print(diff_hr);
    print(diff_mn);
    print(diff_sc/60);

it's Should Show next player is Isha
but it shows Asr

I/flutter ( 3343): nextPrayerTimes Prayer.asr
I/flutter ( 3343): 0
I/flutter ( 3343): -2
I/flutter ( 3343): -130
I/flutter ( 3343): -130.13333333333333
@wael93 wael93 added the bug Something isn't working label Sep 26, 2021
@wael93 wael93 changed the title Next Player by Time Nor Working Next Prayer by Time Nor Working Sep 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant