Fix ReportsView Test Failure - Date Format Issue
Fix ReportsView Test Failure - Date Format Issue
Is your feature request related to a problem? Please describe.
The ReportsView component was incorrectly counting overdue tasks as 0 when they should have been counted properly. The issue was in the countStatuses function which filters tasks by date range.
Root Cause
The original filter logic only included tasks where modifiedDate >= filterDate. This meant that overdue tasks with past due dates were being filtered out before they could be counted as overdue, since their due dates were before the filter date (e.g., before "today" or "start of week").
@its-me-abhishek The reason why the Test Coverage is failing in the PRs due to the Jan 01
If you run this test on: January 1-10: Past due date (10 days ago) falls in December → filtered out → overdue count = 0 January 11+: Past due date (10 days ago) falls in January → included → overdue count = 2
SnapShot :
FIX : Modified the filter logic in ReportsView.tsx
- Include tasks within the time range (original behavior)
- Also include overdue pending tasks even if their due date is before the filter date, since overdue tasks should always appear in current reports
@its-me-abhishek Should I create a PR ?