Refactors occurrences extensions with date filtering#16
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
Contributor
There was a problem hiding this comment.
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 tooccurrences()with optional namedstart/endparameters 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, 0for midnight) when usingCalDateTime.local()or switching toCalDateTime.date() - Moving timezone-related tests from
components_test.darttoqueries_test.dartfor 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.
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.
No description provided.