Skip to content

Comments

Using periods in relative timeframes will now work properly#133

Merged
dorian-krefft-dt merged 2 commits intomainfrom
bugfix/dql/fining-period-relative
Feb 13, 2026
Merged

Using periods in relative timeframes will now work properly#133
dorian-krefft-dt merged 2 commits intomainfrom
bugfix/dql/fining-period-relative

Conversation

@dorian-krefft-dt
Copy link
Collaborator

No description provided.

@dorian-krefft-dt dorian-krefft-dt self-assigned this Feb 13, 2026
Copilot AI review requested due to automatic review settings February 13, 2026 16:18
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 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 Period operations with ZonedDateTime operations
  • 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.

@github-actions
Copy link
Contributor

Qodana for JVM

It 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 report

To be able to view the detailed Qodana report, you can either:

To get *.log files or any other Qodana artifacts, run the action with upload-result option set to true,
so that the action will upload the files as the job artifacts:

      - name: 'Qodana Scan'
        uses: JetBrains/qodana-action@v2025.3.1
        with:
          upload-result: true
Contact Qodana team

Contact us at qodana-support@jetbrains.com

@dorian-krefft-dt dorian-krefft-dt merged commit 42c1c2e into main Feb 13, 2026
9 checks passed
@dorian-krefft-dt dorian-krefft-dt deleted the bugfix/dql/fining-period-relative branch February 14, 2026 17:08
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.

1 participant