typ-AhmedSleem / islamic-toolkit-kt

Free, Open-Source toolkit for most Islamic APIs. Written in pure Kotlin
MIT License
1 stars 1 forks source link

bug: PrayerTimes.current returns same value as PrayerTimes.next #15

Closed typ-AhmedSleem closed 1 year ago

typ-AhmedSleem commented 1 year ago

Bug report

Module: prayertimes

Description: PrayerTimes.current returns same value as PrayerTimes.next

Bug details:

If we have a piece of code like:

val prays = PrayerTimes.getTodayPrays(loc, config)
val currentPray = prays.current
val nextPray = prays.next

// Let's assume that actual current pray is Asr and next pray is Maghrib

print(currentPray.type) // prints: MAGHRIB
print(nextPray.type) // prints: MAGHRIB

it prints the next pray not the current pray as I performed a test but found that both field getters return the same pray

typ-AhmedSleem commented 1 year ago

Tested again and it's working properly