Bug: Reports charts always show 0 and weekly range is incorrect
Describe the bug The Reports feature charts are not displaying data correctly. Charts show 0 counts for all periods (Daily, Weekly, Monthly) even when there are completed and pending tasks. Additionally, the Weekly report uses an incorrect date range calculation.
To Reproduce Steps to reproduce the behavior:
- Go to
http://localhost:5173/home - Ensure you have tasks with various statuses (completed, pending)
- Click "Show Reports" button
- See that all charts display 0 for both "Completed" and "Ongoing"
- Weekly report label says "This Week" but actually calculates last 7 days
Expected behavior
- Charts should correctly display the count of completed and ongoing tasks for each period
- Weekly report should show tasks from the start of the current week (Sunday) to today
- Completed tasks should be counted by their end date, not
modifieddate
Video
https://github.com/user-attachments/assets/cd2f1eb4-76b9-47e5-8df8-cca89ec10148
Root cause
- Taskwarrior dates use format
20241215T130000Zwhich was not being parsed correctly - Weekly calculation used
sevenDaysAgoinstead ofstartOfWeek - Task filtering used
modifieddate instead of end date for completed tasks
Desktop (please complete the following information):
-
OS: macOS
-
Browser: Chrome
-
Version: Latest
-
[X] I want to work on this issue.
Hi @its-me-abhishek! I want to clarify a point in chart should we add "Overdue" as a third category in the Reports chart alongside "Completed" and "Ongoing"? I almost done all core implementation.
Sounds to be a good idea! Though I'd suggest to create another issue for that, as the scopes will be different.
@its-me-abhishek Okay, then I’ll open a PR for this. After solving this issue, I’ll create another issue and a PR for that as well. :)