Skip to content

fix: allow single-date selection in timeline date range picker#767

Merged
ErikBjare merged 1 commit intoActivityWatch:masterfrom
TimeToBuildBob:fix/single-date-selection
Feb 22, 2026
Merged

fix: allow single-date selection in timeline date range picker#767
ErikBjare merged 1 commit intoActivityWatch:masterfrom
TimeToBuildBob:fix/single-date-selection

Conversation

@TimeToBuildBob
Copy link
Contributor

@TimeToBuildBob TimeToBuildBob commented Feb 22, 2026

Summary

When selecting a date range in the timeline, previously both start and end dates were required. This made it cumbersome to view a single day — you had to set both dates to the same value.

Changes:

  • Make end date optional — if only start is set, defaults to showing that single day
  • Add min/max constraints between date inputs to prevent invalid ranges (end before start)
  • Validation (emptyDaterange, invalidDaterange, daterangeTooLong) updated to handle single-date case

Behavior:

  • Select only a start date → shows that day (start to start+1day)
  • Select both start and end → works as before (inclusive range)

Test plan

  • Select only a start date, click Apply → shows that single day
  • Select start and end dates → works as before
  • Verify end date input has min constraint matching start date
  • All 34 existing tests pass
  • No regressions in "last duration" mode

Fixes #596


Important

Allows single-date selection in InputTimeInterval.vue by making end date optional and updating validation logic.

  • Behavior:
    • End date is optional in InputTimeInterval.vue; defaults to single-day view if only start date is set.
    • Adds min/max constraints to date inputs to prevent invalid ranges.
    • Updates validation (emptyDaterange, invalidDaterange, daterangeTooLong) to handle single-date case.
  • UI:
    • end input has min constraint matching start date.
    • end input has placeholder "(optional)".
  • Logic:
    • value computed property in InputTimeInterval.vue updated to handle single-date selection.
    • emptyDaterange now returns false if start is set.
    • invalidDaterange and daterangeTooLong return false if end is not set.

This description was created by Ellipsis for 5e8849e. You can customize this summary. It will automatically update as commits are pushed.

When selecting a date range, previously both start and end dates were
required. Now only the start date is required — if the end date is
omitted, the range defaults to that single day (start to start+1day).

Also adds min/max constraints between the date inputs to prevent
selecting an end date before the start date.

Fixes ActivityWatch#596
Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

Important

Looks good to me! 👍

Reviewed everything up to 5e8849e in 6 seconds. Click for details.
  • Reviewed 46 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 0 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.

Workflow ID: wflow_1tZWJS8EMhyLBPMj

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 22, 2026

Greptile Summary

Modified the timeline date range picker to allow single-date selection by making the end date optional. When only a start date is set, the component now defaults to showing that single day (start to start+1day). The validation logic (emptyDaterange, invalidDaterange, daterangeTooLong) was updated to handle the optional end date case correctly, and HTML5 min/max constraints were added to the date inputs to prevent invalid range entry at the UI level.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The changes are well-contained, logically sound, and backwards compatible. The logic correctly handles both single-date and date-range modes, validation is properly updated to handle the optional end date, and HTML5 constraints prevent invalid user input
  • No files require special attention

Important Files Changed

Filename Overview
src/components/InputTimeInterval.vue Made end date optional in date range picker, allowing single-date selection with proper validation updates

Last reviewed commit: 5e8849e

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

1 file reviewed, no comments

Edit Code Review Agent Settings | Greptile

@codecov
Copy link

codecov bot commented Feb 22, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 25.60%. Comparing base (934daca) to head (5e8849e).
⚠️ Report is 3 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #767      +/-   ##
==========================================
- Coverage   25.67%   25.60%   -0.08%     
==========================================
  Files          30       30              
  Lines        1741     1746       +5     
  Branches      316      314       -2     
==========================================
  Hits          447      447              
+ Misses       1272     1233      -39     
- Partials       22       66      +44     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@TimeToBuildBob
Copy link
Contributor Author

The Test (node-20, py-3.9, aw-server-rust master) check failure is a pre-existing upstream issue — the cleanup step tries to glob ~/.cache/activitywatch/log/*/*.log but aw-server-rust master doesn't write logs to that path. All actual test steps pass. PR #768 fixes this by using shopt -s nullglob in the cleanup steps.

@ErikBjare ErikBjare merged commit 8d32ea9 into ActivityWatch:master Feb 22, 2026
7 of 8 checks passed
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

Successfully merging this pull request may close these issues.

Timeline: select only one date selects this date

2 participants