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

Stats sum is wrong, if "This Year" is selected #87

Closed
heikok88 opened this issue Apr 24, 2022 · 8 comments
Closed

Stats sum is wrong, if "This Year" is selected #87

heikok88 opened this issue Apr 24, 2022 · 8 comments

Comments

@heikok88
Copy link
Contributor

heikok88 commented Apr 24, 2022

Please complete the following information

  • Installation Type: Docker
  • Have you tried using the latest docker image / code base yes

Describe the bug
I have only one Vehicle in Hammond with only 5 fillups in 2022.
The stats are wrong if I select "This Year".
"Past 3 Months" and "All Time" are correct. See the screenshots

Expected behavior
If "This Year" is selected, the first fillup (Jan 25, 2022, 78,93 €) is missing in the sum and should be included.

Screenshots
Stats_ThisYear_wrong
Stats_Past3Month_correct
Stats_AllTime_correct
Fillups

@akhilrex
Copy link
Owner

Will look into it

@heikok88
Copy link
Contributor Author

Thx! If you need my db, logs or something like that let me know.

@heikok88
Copy link
Contributor Author

Might it possible, that the first fillup to a vehicle is not included in the sum?

If you need help let me know, I'm a (embedded) software engineer ;-)

@heikok88 heikok88 reopened this Jul 11, 2022
@heikok88
Copy link
Contributor Author

I've looked into the code and found the error:
In your statsWidget.vue, you have to pass 0 as month for january. The days start by 1, but the month start by 0.

@heikok88
Copy link
Contributor Author

I've found another error. If in the stats "This week" is selected, you need to call toDate.setHours(0, 0, 0, 0) to set the time to midnight.
Because otherwise the the fillup of mondays before the time of the requests are not included.

@heikok88
Copy link
Contributor Author

Should I create a pullrequest?

@akhilrex
Copy link
Owner

akhilrex commented Jul 12, 2022 via email

@heikok88
Copy link
Contributor Author

Just created the PR
Greets

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

No branches or pull requests

2 participants