Skip to content

Fix custom date range filter excluding sessions on end date#14430

Merged
rtibbles merged 1 commit intolearningequality:release-v0.19.xfrom
rtibbles:today_and_today_and_today
Mar 19, 2026
Merged

Fix custom date range filter excluding sessions on end date#14430
rtibbles merged 1 commit intolearningequality:release-v0.19.xfrom
rtibbles:today_and_today_and_today

Conversation

@rtibbles
Copy link
Member

Summary

Custom date range filter in Attendance History excluded all sessions on the selected end date. KDateRange returns Date objects at midnight (start of day), and the backend end_date filter uses exclusive lt. Sending midnight of the selected date meant session_start_datetime < midnight excluded the entire day.

Fix: add one day to the custom end date before sending, so the exclusive lt boundary includes all sessions on the selected date.

Screenshot
Custom date filter showing today's session

References

Fixes #14424

Reviewer guidance

  1. Mark attendance for a class
  2. Go to Attendance History, select Custom date range, pick today as both start and end date
  3. Verify today's session appears in the results

The change is in getDateRange() in AttendanceHistoryPage.vue:191-200 — only the custom date range path is affected. Preset ranges (Last 7/30/365 days) already use now() which works correctly with the lt filter.

AI usage

This PR was implemented by Claude Code using TDD. Tests were written first, verified failing, then the fix was applied and verified passing. Manual verification was done via Playwright browser automation and confirmed independently by me in my own browser session.

KDateRange returns Date objects at midnight (start of day). The frontend
sent this raw value as end_date, but the backend filter uses exclusive lt,
so all sessions on the selected end date were excluded. Add one day to the
end date before sending so the exclusive boundary includes the full day.

Fixes learningequality#14424

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions github-actions bot added DEV: backend Python, databases, networking, filesystem... APP: Coach Re: Coach App (lessons, quizzes, groups, reports, etc.) DEV: frontend SIZE: small labels Mar 19, 2026
@rtibbles rtibbles marked this pull request as ready for review March 19, 2026 18:31
Copy link
Member

@marcellamaki marcellamaki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code changes make sense for the handling of this case, and manual QA confirms

@rtibbles rtibbles merged commit ecd7836 into learningequality:release-v0.19.x Mar 19, 2026
56 checks passed
@rtibbles rtibbles deleted the today_and_today_and_today branch March 19, 2026 21:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

APP: Coach Re: Coach App (lessons, quizzes, groups, reports, etc.) DEV: backend Python, databases, networking, filesystem... DEV: frontend SIZE: small

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants