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

NaN in weekly goal #432

Closed
jaragunde opened this issue Dec 1, 2018 · 1 comment
Closed

NaN in weekly goal #432

jaragunde opened this issue Dec 1, 2018 · 1 comment

Comments

@jaragunde
Copy link
Member

Open phpreport in 31st Dec, 2018; the displayed weekly goal is "NaN".

I suspect the problem is that 31st Dec is part of 2018 but belongs to week 1, 2019. The calculated goal for the rest of week 1, 2019 should be checked too.

anarute added a commit that referenced this issue Oct 1, 2021
If the week in case is the last week of the year,
this method would fail because weeksTillEndOfJourneyPeriod
is 0, causing a division by 0 exception

Fixes #432
@jaragunde
Copy link
Member Author

Fixed by this commit, reviewed in PR #520. Mind you that the result provided is 0 and not the correct one, but we'd need more work and will be revisited in #521.

commit 526d37719cd4ae447c1fb81e57428de4b33f62d8
Author: Ana Rute Mendes <ana@igalia.com>
Date:   Wed Sep 29 16:39:35 2021 -0300

    Fix weekly goal calc if in last week of the year
    
    If the week in case is the last week of the year,
    this method would fail because weeksTillEndOfJourneyPeriod
    is 0, causing a division by 0 exception
    
    Fixes https://github.com/Igalia/phpreport/issues/432

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant