Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

fix(insights): rename 'Year to date' date preset to 'This year' (#72000)

Luke Beltonfedac3adf328
diff --git a/frontend/snapshots.yml b/frontend/snapshots.yml
index 7e145371a3c1..e63ed320879a 100644
--- a/frontend/snapshots.yml
+++ b/frontend/snapshots.yml
@@ -1681,9 +1681,9 @@ snapshots:
components-property-key-info--property-key-info--light:
hash: v1.k794b7964.2f0245e1b92aba6695884bdf695034bf1efd85caca619940965a08338f15e41c.5Z7YHy2M9ko_15_blb0NaI7WmQeXytUWAntBAs03Qr0
components-quill-date-filter--date-filter--dark:
- hash: v1.k794b7964.95c2626b3630789e4e2d50e6e7b079f9ef08687394eb554aa9b71b63c49013ba.G6jYIZtuERuM2gcpHIzsC0DnqeyFryQvG3ufGAwtDN4
+ hash: v1.k794b7964.d2f042b099df421da94056b983d5566d502ac18a0d0e7c7002278ee7af9357a8.o4RyqSP9P5diOgMObTJW1Bf9lcVyxZhnzGqeNuuYE0I
components-quill-date-filter--date-filter--light:
- hash: v1.k794b7964.3261cd882abf712af7f05888ef57f337a983d63a9e40007c793f679feeb54d68.26SGhF1NywF2el4OTnoRoh4fzLlUC2HheCjzewhbHGs
+ hash: v1.k794b7964.a770e13c3ecde25df290e1116569ce0a46eba905f3794b1b48075df46bba6967.RK5TyOViEf-rvm4-KR-8YaSvJeU14hVDvdOoACvcKJ0
components-quill-date-filter--date-filter-with-calendar--dark:
hash: v1.k794b7964.869925bf268235bb1467d6b353cac80309d09185974f2391bf7d130103dc0e5d.UxBOD2PzL78buiHJ446jBawmOlPZpkKJ5veB_O2zBLU
components-quill-date-filter--date-filter-with-calendar--light:
diff --git a/frontend/src/lib/components/DateFilter/DateRangePresetsPanel.tsx b/frontend/src/lib/components/DateFilter/DateRangePresetsPanel.tsx
index d82868fe72de..b3323a92253d 100644
--- a/frontend/src/lib/components/DateFilter/DateRangePresetsPanel.tsx
+++ b/frontend/src/lib/components/DateFilter/DateRangePresetsPanel.tsx
@@ -45,7 +45,7 @@ const DEFAULT_SHORT_CHIPS: DateRangeChip[] = [
{ label: '1m', selection: { kind: 'rolling', count: 1, unit: 'months' } },
{ label: '1y', selection: { kind: 'rolling', count: 1, unit: 'years' } },
]
-const DEFAULT_NAMED_CHIPS = ['Today', 'Yesterday', 'This week', 'This month', 'Year to date', 'All time']
+const DEFAULT_NAMED_CHIPS = ['Today', 'Yesterday', 'This week', 'This month', 'This year', 'All time']
export function dateRangeSelectionLabel(selection: DateRangeSelection): string {
if (selection.kind === 'rolling') {
@@ -81,7 +81,7 @@ function fixedRange(name: string, now: Dayjs, weekStartsOn: 0 | 1): { start: Day
return { start: now.startOf('month'), end: now }
case 'Last month':
return { start: now.subtract(1, 'month').startOf('month'), end: now.subtract(1, 'month').endOf('month') }
- case 'Year to date':
+ case 'This year':
return { start: now.startOf('year'), end: now }
default:
return { start: now.subtract(ALL_TIME_SEED_YEARS, 'years'), end: now }
diff --git a/frontend/src/lib/components/DateFilter/dateRangeSelection.test.ts b/frontend/src/lib/components/DateFilter/dateRangeSelection.test.ts
index 680cb0781a78..35b4a94b924e 100644
--- a/frontend/src/lib/components/DateFilter/dateRangeSelection.test.ts
+++ b/frontend/src/lib/components/DateFilter/dateRangeSelection.test.ts
@@ -13,7 +13,7 @@ describe('date range selection mapping', () => {
['-1mStart', '-1mEnd', { kind: 'fixed', name: 'Last month' }],
['wStart', null, { kind: 'fixed', name: 'This week' }],
['mStart', null, { kind: 'fixed', name: 'This month' }],
- ['yStart', null, { kind: 'fixed', name: 'Year to date' }],
+ ['yStart', null, { kind: 'fixed', name: 'This year' }],
['all', null, { kind: 'fixed', name: 'All time' }],
] as const)('round-trips %s / %s', (dateFrom, dateTo, expected) => {
const selection = selectionForDateRange(dateFrom, dateTo)
diff --git a/frontend/src/lib/components/IframedToolbarBrowser/utils.ts b/frontend/src/lib/components/IframedToolbarBrowser/utils.ts
index b02242769332..785cf76f6749 100644
--- a/frontend/src/lib/components/IframedToolbarBrowser/utils.ts
+++ b/frontend/src/lib/components/IframedToolbarBrowser/utils.ts
@@ -40,7 +40,7 @@ export const calculateViewportRange = (
// some of the date options we allow in insights don't apply to heatmaps
// let's filter the list down
-const dateItemDenyList = ['Last 180 days', 'This month', 'Previous month', 'Year to date', 'All time']
+const dateItemDenyList = ['Last 180 days', 'This month', 'Previous month', 'This year', 'All time']
export const heatmapDateOptions = dateMapping.filter(
(dm) => dm.key !== CUSTOM_OPTION_KEY && !dateItemDenyList.includes(dm.key)
)
diff --git a/frontend/src/lib/utils/dateFilters.ts b/frontend/src/lib/utils/dateFilters.ts
index 6810b07a5380..871094cdfda9 100644
--- a/frontend/src/lib/utils/dateFilters.ts
+++ b/frontend/src/lib/utils/dateFilters.ts
@@ -101,11 +101,11 @@ export const dateMapping: DateMappingOption[] = [
{
key: 'This month',
values: ['mStart'],
- getFormattedDate: (date: dayjs.Dayjs): string => formatDateRange(date.startOf('month'), date.endOf('month')),
+ getFormattedDate: (date: dayjs.Dayjs): string => formatDateRange(date.startOf('month'), date.endOf('d')),
defaultInterval: 'day',
},
{
- key: 'Year to date',
+ key: 'This year',
values: ['yStart'],
getFormattedDate: (date: dayjs.Dayjs): string => formatDateRange(date.startOf('y'), date.endOf('d')),
defaultInterval: 'month',
diff --git a/frontend/src/scenes/billing/billingUsageLogic.ts b/frontend/src/scenes/billing/billingUsageLogic.ts
index 5ede8a0e5422..807f03329ea3 100644
--- a/frontend/src/scenes/billing/billingUsageLogic.ts
+++ b/frontend/src/scenes/billing/billingUsageLogic.ts
@@ -30,7 +30,7 @@ import type { BillingFilters } from './types'
import type { BillingUsageInteractionProps } from './types'
// These date filters return correct data but there's an issue with filter label after selecting it, showing 'No date range override' instead
-const TEMPORARILY_EXCLUDED_DATE_FILTER_OPTIONS = ['This month', 'Year to date', 'All time']
+const TEMPORARILY_EXCLUDED_DATE_FILTER_OPTIONS = ['This month', 'This year', 'All time']
export enum BillingUsageResponseBreakdownType {
TYPE = 'type',
diff --git a/frontend/src/scenes/insights/filters/InsightDateFilter/InsightQuillDateFilter.tsx b/frontend/src/scenes/insights/filters/InsightDateFilter/InsightQuillDateFilter.tsx
index 60c5afb9dd5a..e0a2f2193735 100644
--- a/frontend/src/scenes/insights/filters/InsightDateFilter/InsightQuillDateFilter.tsx
+++ b/frontend/src/scenes/insights/filters/InsightDateFilter/InsightQuillDateFilter.tsx
@@ -32,7 +32,7 @@ import { computeDaysOfWeekUpdate, getExcludedDaysOfWeek, type IsoDayOfWeek } fro
// Chip labels double as dateMapping keys; filter at module load so a renamed chip can never
// silently produce the wrong range.
-const NAMED_CHIPS = ['Today', 'Yesterday', 'This week', 'This month', 'Year to date', 'All time'].filter((name) =>
+const NAMED_CHIPS = ['Today', 'Yesterday', 'This week', 'This month', 'This year', 'All time'].filter((name) =>
dateMapping.some(({ key }) => key === name)
)
diff --git a/frontend/src/scenes/retention/retentionLogic.ts b/frontend/src/scenes/retention/retentionLogic.ts
index 8313b22885c6..cb6aa99754d5 100644
--- a/frontend/src/scenes/retention/retentionLogic.ts
+++ b/frontend/src/scenes/retention/retentionLogic.ts
@@ -488,7 +488,7 @@ export const retentionLogic = kea<retentionLogicType>([
values: [`-90${periodChar}`],
},
{
- key: 'Year to date',
+ key: 'This year',
values: ['yStart'],
getFormattedDate: (date: dayjs.Dayjs): string =>
formatDateRange(date.startOf('y'), date.endOf('d')),
diff --git a/products/customer_analytics/frontend/CustomerAnalyticsFilters.tsx b/products/customer_analytics/frontend/CustomerAnalyticsFilters.tsx
index 4a376dda7f30..dc439d383ece 100644
--- a/products/customer_analytics/frontend/CustomerAnalyticsFilters.tsx
+++ b/products/customer_analytics/frontend/CustomerAnalyticsFilters.tsx
@@ -67,7 +67,7 @@ const DATE_FILTER_DATE_OPTIONS: DateMappingOption[] = [
defaultInterval: 'day',
},
{
- key: 'Year to date',
+ key: 'This year',
values: ['yStart'],
getFormattedDate: (date: dayjs.Dayjs): string => formatDateRange(date.startOf('y'), date),
defaultInterval: 'week',
diff --git a/products/endpoints/frontend/EndpointsUsageFilters.tsx b/products/endpoints/frontend/EndpointsUsageFilters.tsx
index 3072ea193401..2e52f83e4cb9 100644
--- a/products/endpoints/frontend/EndpointsUsageFilters.tsx
+++ b/products/endpoints/frontend/EndpointsUsageFilters.tsx
@@ -52,7 +52,7 @@ const endpointsUsageDateMapping: DateMappingOption[] = [
defaultInterval: 'day',
},
{
- key: 'Year to date',
+ key: 'This year',
values: ['yStart'],
getFormattedDate: (date: dayjs.Dayjs): string => formatDateRange(date.startOf('y'), date.endOf('d')),
defaultInterval: 'day',
diff --git a/products/engineering_analytics/frontend/scenes/EngineeringAnalyticsAuthorScene.tsx b/products/engineering_analytics/frontend/scenes/EngineeringAnalyticsAuthorScene.tsx
index 8faa7148f559..b756ec218c07 100644
--- a/products/engineering_analytics/frontend/scenes/EngineeringAnalyticsAuthorScene.tsx
+++ b/products/engineering_analytics/frontend/scenes/EngineeringAnalyticsAuthorScene.tsx
@@ -29,7 +29,7 @@ import { SHARED_DEFAULT_DATE_FROM, engineeringAnalyticsFiltersLogic } from './en
// are always a subset of the loaded PRs — a Custom range could reach past the load and desync the tiles
// from the server-windowed workflow breakdown.
const AUTHOR_DATE_OPTIONS = dateMapping.filter(({ key }) =>
- ['Last 7 days', 'Last 14 days', 'Last 30 days', 'Last 90 days', 'Last 180 days', 'Year to date'].includes(key)
+ ['Last 7 days', 'Last 14 days', 'Last 30 days', 'Last 90 days', 'Last 180 days', 'This year'].includes(key)
)
export const scene: SceneExport<AuthorLogicProps> = {