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

fix: current prayer time 0:0 if next prayer fajr #4

Closed
wants to merge 2 commits into from

Conversation

Moanrisy
Copy link

Bug: remaining time before next prayer is showing 0:0 if current prayer is isya

The usual next_prayer - current_time not gonna work
Because fajr time value is less than current time (after isya)

@azzamsa
Copy link
Owner

azzamsa commented Sep 1, 2023

Thanks for finding all the bugs and all your awesome PRs! ❤️

I use this simpler approach instead.

        // Special case if the next prayer time is on the following day
        if self.next() == Prayer::FajrTomorrow {
            // Current time is after midnight
            if now.time() < self.fajr_tomorrow.time() {
                now += Duration::days(1);
            }
        }

@azzamsa azzamsa closed this Sep 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants