Using periods in relative timeframes will now work properly#133
Using periods in relative timeframes will now work properly#133dorian-krefft-dt merged 2 commits intomainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes a bug where date-based relative timeframes (weeks, months, quarters, years) were not working properly in DQL queries. The issue was caused by attempting to use Java's Period class with Instant.plus(), which is not supported for date-based units. The fix converts the Instant to ZonedDateTime, performs the date arithmetic, and converts back to Instant.
Changes:
- Fixed date-based duration calculations by replacing
Periodoperations withZonedDateTimeoperations - Corrected QUARTER calculation from 4 months to 3 months (fixing a secondary bug)
- Updated CHANGELOG to document the bug fix
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/main/java/pl/thedeem/intellij/dql/definition/model/DQLDurationType.java | Replaced Period-based operations with ZonedDateTime-based operations for WEEK, MONTH, QUARTER, and YEAR duration types; corrected QUARTER from 4 to 3 months |
| CHANGELOG.md | Added bug fix entry describing the fix for relative timeframes with periods |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Qodana for JVMIt seems all right 👌 No new problems were found according to the checks applied 💡 Qodana analysis was run in the pull request mode: only the changed files were checked View the detailed Qodana reportTo be able to view the detailed Qodana report, you can either:
To get - name: 'Qodana Scan'
uses: JetBrains/qodana-action@v2025.3.1
with:
upload-result: trueContact Qodana teamContact us at qodana-support@jetbrains.com
|
No description provided.