[Dashboards]: polish week on date granularity #16128
Merged
bosiraphael merged 5 commits intomainfrom Nov 27, 2025
Merged
Conversation
Contributor
Greptile OverviewGreptile SummaryFixed critical bug where week granularity was incrementing by 1 day instead of 7 days, and enhanced week date formatting to display proper date ranges (e.g., "May 6 - 12, 2024") Key Changes:
Issue Found:
Confidence Score: 4/5
Important Files ChangedFile Analysis
Sequence DiagramsequenceDiagram
participant Component as Graph Widget Component
participant Hook as useGraphWidgetGroupByQuery
participant DateTime as useDateTimeFormat
participant GenBar as generateGroupByQueryVariablesFromBarOrLineChartConfiguration
participant GenPie as generateGroupByQueryVariablesFromPieChartConfiguration
participant Build as buildGroupByFieldObject
participant Apollo as Apollo Client
participant Format as formatDateByGranularity
Component->>Hook: Request graph data
Hook->>DateTime: Get user preferences
DateTime-->>Hook: Return calendarStartDay
alt Pie Chart
Hook->>GenPie: Generate query variables(firstDayOfTheWeek)
GenPie->>Build: buildGroupByFieldObject(field, dateGranularity, firstDayOfTheWeek)
else Bar/Line Chart
Hook->>GenBar: Generate query variables(firstDayOfTheWeek)
GenBar->>Build: buildGroupByFieldObject(field, dateGranularity, firstDayOfTheWeek)
end
alt Week Granularity & Not SYSTEM
Build-->>GenBar: Return {field: {granularity: WEEK, weekStartDay: MONDAY/SUNDAY}}
else Other Cases
Build-->>GenBar: Return {field: {granularity: granularity}}
end
GenBar-->>Hook: Return groupBy variables with weekStartDay
Hook->>Apollo: Execute GraphQL query
Apollo-->>Hook: Return aggregated data
Hook-->>Component: Return query results
Component->>Format: formatDateByGranularity(date, WEEK)
Format-->>Component: Return formatted week range (e.g., "May 6 - 12, 2024")
|
packages/twenty-front/src/modules/page-layout/widgets/graph/utils/formatDateByGranularity.ts
Outdated
Show resolved
Hide resolved
Contributor
|
🚀 Preview Environment Ready! Your preview environment is available at: http://bore.pub:19306 This environment will automatically shut down when the PR is closed or after 5 hours. |
Contributor
|
Thanks @ehconitin for your contribution! |
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.

CleanShot.2025-11-27.at.18.15.45.mp4