feat: add --from/--to date range filtering to events list#2
Open
junior-ricon wants to merge 5 commits into
Open
feat: add --from/--to date range filtering to events list#2junior-ricon wants to merge 5 commits into
junior-ricon wants to merge 5 commits into
Conversation
Thread io-calendar's new TimeRange through the client stack so `calendula events list <calendar> --from 2026-02-14 --to 2026-02-21` sends a CalDAV calendar-query REPORT with <C:time-range> filter, letting the server return only events in the requested range. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Remove sentinel dates, use Option fields from io-calendar's TimeRange - Import TimeRange from public re-export path (io_calendar::caldav) - Add warning when vdir backend ignores date filtering Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Author
|
Updated based on review feedback from two colleagues:
|
--to now includes events on the specified date (shifts end bound to the next day for CalDAV). Uses the validated TimeRange::new() constructor instead of struct literal. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ests - Extract time-range building into a testable function - Replace silent unwrap_or fallback with explicit error for out-of-range --to - Add 6 tests covering inclusive --to semantics, month/year boundaries, and both-None case Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
3 tasks
Author
|
Final updates after three rounds of internal review:
Note: |
The Cargo.toml patch was temporarily pointing at our fork during development. Revert to upstream — this PR depends on pimalaya/io-calendar#1 being merged first. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
--fromand--toflags tocalendula events listfor server-side date filteringTimeRangefrom io-calendar throughCaldavClientandClientDepends on: pimalaya/io-calendar#1
Usage
Changes
src/event/command/list.rs— Parse--from/--toasNaiveDate, convert toTimeRange, calllist_events_in_range()when presentsrc/client.rs— Addlist_events_in_range()that delegates to backendsrc/caldav/client.rs— Addlist_events_in_range()usingListCalendarItems::with_time_range()Cargo.toml— Point io-calendar at fork (temporary, until io-calendar PR merges)Test plan
events list calendarwithout flags still works (no regression)events list calendar --from 2026-02-14 --to 2026-02-21returns only events in rangeevents list calendar --from 2026-02-14returns events from that date onwardsevents list calendar --to 2026-03-01returns events up to that date--helpshows the new flags with descriptions