Feature Request: Expand week start day setting to support all days of the week
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 39.9k
- Forks
- 3.4k
- Avg merge
- 6h 51m
- Merged PRs (30d)
- 232
Description
Is your feature request related to a problem?
PostHog's existing week start day setting (Project Settings) only supports Sunday or Monday, so weekly groupings in trends, insights, and dashboards can't align with other reporting calendars.
Describe the solution you'd like
Expand the existing week_start_day setting on the Team model to support all seven days of the week, not just Sunday and Monday. This should apply everywhere weekly groupings are used: trends, insights, and dashboards.
Describe alternatives you've considered
Exporting data and manually processing it outside PostHog to align with the other week structure. This works but is time-consuming and defeats the purpose of in-product reporting.
Additional context
- The setting already exists at
posthog/models/team/team.py(WeekStartDayenum) with a UI infrontend/src/scenes/settings/environment/WeekStartConfig.tsx, but is restricted toSUNDAY (0)andMONDAY (1). - ClickHouse's
toStartOfWeeksupports modes 0–9 with varying week start days, so arbitrary days may require usingtoStartOfIntervalor custom date arithmetic instead. - Areas that would need changes: the
WeekStartDayenum, the settings UI,query_date_range.py(date alignment + HogQL generation),timestamp_utils.py(label formatting), and frontend date utilities (dateTimeUtils.ts). - From: https://posthoghelp.zendesk.com/agent/tickets/51923 (moved to PostHog: https://us.posthog.com/project/2/support/tickets/53628)
Debug info
Kind: feedback
Target area: analytics
Report event: http://go/ticketByUUID/41705ec3-079f-4158-9054-9a057f54de4c
Session: https://us.posthog.com/project/sTMFPsFhdP1Ssg/replay/019c9f7a-6efe-7529-b9a6-4f274748ae67?t=315
Exceptions: https://us.posthog.com/project/2/error_tracking?filterGroup=%7B%22type%22%3A%22AND%22%2C%22values%22%3A%5B%7B%22type%22%3A%22AND%22%2C%22values%22%3A%5B%7B%22key%22%3A%22%24session_id%22%2C%22value%22%3A%5B%22019c9f7a-6efe-7529-b9a6-4f274748ae67%22%5D%2C%22operator%22%3A%22exact%22%2C%22type%22%3A%22event%22%7D%5D%7D%5D%7D
Location: https://eu.posthog.com/project/7005/insights/gS4pm6Qj/edit?dashboard=174026#q=%7B%22kind%22%3A%22InsightVizNode%22%2C%22source%22%3A%7B%22aggregation_group_type_index%22%3Anull%2C%22breakdownFilter%22%3A%7B%22breakdowns%22%3A%5B%7B%22property%22%3A%22utm_medium%22%2C%22type%22%3A%22event%22%7D%5D%7D%2C%22compareFilter%22%3Anull%2C%22conversionGoal%22%3Anull%2C%22dataColorTheme%22%3Anull%2C%22dateRange%22%3A%7B%22date_from%22%3A%222025-01-01T00%3A00%3A00%22%2C%22date_to%22%3Anull%2C%22explicit...&
Persons-on-events mode for project: person_id_no_override_properties_on_events
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the existing WeekStartDay enum in posthog/models/team/team.py through frontend/src/scenes/settings/environment/WeekStartConfig.tsx, query_date_range.py, timestamp_utils.py, and dateTimeUtils.ts. Check how weekly grouping and labels are aligned today, then verify that all seven settings produce consistent trends, insights, and dashboard weeks.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- clickhouse, python, typescript
- Domain
- analytics, backend, frontend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100