Skip to content

Refactors occurrences extensions with date filtering#16

Merged
kozw merged 3 commits intomainfrom
enhancements
Nov 7, 2025
Merged

Refactors occurrences extensions with date filtering#16
kozw merged 3 commits intomainfrom
enhancements

Conversation

@kozw
Copy link
Owner

@kozw kozw commented Nov 7, 2025

No description provided.

Copilot AI review requested due to automatic review settings November 7, 2025 14:36
@codecov
Copy link

codecov bot commented Nov 7, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.30%. Comparing base (194e8a1) to head (b324755).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #16      +/-   ##
==========================================
- Coverage   97.30%   97.30%   -0.01%     
==========================================
  Files          15       15              
  Lines        2153     2151       -2     
==========================================
- Hits         2095     2093       -2     
  Misses         58       58              

☔ 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.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors the API for querying event/todo/journal/timezone occurrences within date ranges. The main changes include:

  • Renaming the inRange() method to occurrences() with optional named start/end parameters instead of required positional parameters
  • Making date range filtering optional - calling occurrences() without parameters returns all occurrences
  • Simplifying test code by removing unnecessary time components (e.g., 0, 0, 0 for midnight) when using CalDateTime.local() or switching to CalDateTime.date()
  • Moving timezone-related tests from components_test.dart to queries_test.dart for better organization
  • Updating documentation to reflect the new API

Reviewed Changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated no comments.

Show a summary per file
File Description
lib/src/semantic/recurrence/recurrence_iterator.dart Added optional start, end, and duration parameters to occurrences() method
lib/src/semantic/extensions/queries.dart Renamed inRange() to occurrences() with optional parameters for all component types
lib/src/semantic/extensions/components.dart Updated component extension methods to accept optional start/end parameters
lib/src/semantic/extensions/calendar_types.dart Simplified dayOfYear implementation using CalDateTime.date()
test/semantic/extensions/queries_test.dart Updated all test cases to use new occurrences() API and simplified date/time creation
test/semantic/extensions/components_test.dart Removed timezone tests (moved to queries_test.dart) and simplified date creation
test/semantic/filters_test.dart Simplified CalDateTime.local() calls by removing unnecessary parameters
test/semantic/extensions/calendar_types_test.dart Simplified date creation in tests
test/semantic/end_to_end_test.dart Simplified date creation in assertions
test/semantic/calendar_test.dart Simplified date creation in assertions
README.md Updated documentation with new API examples and added section on getting all occurrences

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@kozw kozw merged commit 60e69b7 into main Nov 7, 2025
9 checks passed
@kozw kozw deleted the enhancements branch November 7, 2025 14:40
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.

2 participants