PostHog / PostHog/posthog

Feature Request: Expand week start day setting to support all days of the week

Open
#49,786 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement feature/settings team/product-analytics team/query-performance ux
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 (WeekStartDay enum) with a UI in frontend/src/scenes/settings/environment/WeekStartConfig.tsx, but is restricted to SUNDAY (0) and MONDAY (1).
  • ClickHouse's toStartOfWeek supports modes 0–9 with varying week start days, so arbitrary days may require using toStartOfInterval or custom date arithmetic instead.
  • Areas that would need changes: the WeekStartDay enum, 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.