-
Notifications
You must be signed in to change notification settings - Fork 4.7k
[Dashboards]: polish week on date granularity #16128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
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")
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
8 files reviewed, 1 comment
packages/twenty-front/src/modules/page-layout/widgets/graph/utils/formatDateByGranularity.ts
Outdated
Show resolved
Hide resolved
|
🚀 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. |
bosiraphael
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
Thanks @ehconitin for your contribution! |

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