Skip to content

Conversation

hank-sq
Copy link
Contributor

@hank-sq hank-sq commented Oct 10, 2025

Check List

  • Tests have been run in packages where changes have been made if available
  • Linter has been run for changed code
  • Tests for the changes have been added if not covered yet
  • Docs have been added / updated if required

Issue Reference this PR resolves

#10042

Description of Changes Made (if issue reference is not provided)

Adds support for a query-time offset parameter on timeDimensions that allows shifting time boundaries for predefined granularities (day, week, month, etc.). This enables use cases like:

  • Days running 2am-2am instead of midnight-midnight
  • Weeks starting on Wednesday instead of Monday

The offset parameter:

  • Only works with predefined granularities (day, week, month, etc.)
  • Throws a validation error if used with custom granularities
  • Uses SQL interval syntax (e.g., "2 hours", "-30 minutes", "2 days")
  • Is supported in REST API and GraphQL API

Includes comprehensive unit and integration tests demonstrating the day-shifting and week-shifting use cases.

Adds support for a query-time `offset` parameter on timeDimensions that
allows shifting time boundaries for predefined granularities (day, week,
month, etc.). This enables use cases like:
- Days running 2am-2am instead of midnight-midnight
- Weeks starting on Wednesday instead of Monday

The offset parameter:
- Only works with predefined granularities (day, week, month, etc.)
- Throws a validation error if used with custom granularities
- Uses SQL interval syntax (e.g., "2 hours", "-30 minutes", "2 days")
- Is supported in REST API and GraphQL API

Includes comprehensive unit and integration tests demonstrating the
day-shifting and week-shifting use cases.
@hank-sq hank-sq requested review from a team as code owners October 10, 2025 18:37
@github-actions github-actions bot added the pr:community Contribution from Cube.js community members. label Oct 10, 2025
@hank-sq hank-sq marked this pull request as draft October 10, 2025 18:43
@igorlukanin igorlukanin self-assigned this Oct 13, 2025
@igorlukanin
Copy link
Member

@hank-sq Please see my comment here: #10042 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr:community Contribution from Cube.js community members.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants