From 8614cc7c7a1a26d1476a02d1788c6d2bfa88e0e4 Mon Sep 17 00:00:00 2001 From: Jake Hoban Date: Thu, 3 Oct 2024 20:06:53 +0100 Subject: [PATCH] Updated previous quarter language in response to feedback from @michael-s-molina --- .../superset-ui-core/src/time-comparison/getTimeOffset.ts | 2 +- .../explore/components/controls/DateFilterControl/types.ts | 4 ++-- .../controls/DateFilterControl/utils/constants.ts | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/superset-frontend/packages/superset-ui-core/src/time-comparison/getTimeOffset.ts b/superset-frontend/packages/superset-ui-core/src/time-comparison/getTimeOffset.ts index d3bd20c9552c..717e44dbab93 100644 --- a/superset-frontend/packages/superset-ui-core/src/time-comparison/getTimeOffset.ts +++ b/superset-frontend/packages/superset-ui-core/src/time-comparison/getTimeOffset.ts @@ -78,7 +78,7 @@ export const parseDttmToDate = ( now.setMonth(now.getMonth() - 1); } return now; - case 'previous quarter': { + case 'previous calendar quarter': { const quarter = Math.floor(now.getMonth() / 3); newdate = new Date(now.getFullYear(), quarter * 3 - 3, 1); return newdate; diff --git a/superset-frontend/src/explore/components/controls/DateFilterControl/types.ts b/superset-frontend/src/explore/components/controls/DateFilterControl/types.ts index f3f8418197e2..09a596645380 100644 --- a/superset-frontend/src/explore/components/controls/DateFilterControl/types.ts +++ b/superset-frontend/src/explore/components/controls/DateFilterControl/types.ts @@ -80,12 +80,12 @@ export type CommonRangeType = export const PreviousCalendarWeek = 'previous calendar week'; export const PreviousCalendarMonth = 'previous calendar month'; -export const PreviousQuarter = 'previous quarter'; +export const PreviousCalendarQuarter = 'previous calendar quarter'; export const PreviousCalendarYear = 'previous calendar year'; export type CalendarRangeType = | typeof PreviousCalendarWeek | typeof PreviousCalendarMonth - | typeof PreviousQuarter + | typeof PreviousCalendarQuarter | typeof PreviousCalendarYear; export const CurrentDay = 'Current day'; diff --git a/superset-frontend/src/explore/components/controls/DateFilterControl/utils/constants.ts b/superset-frontend/src/explore/components/controls/DateFilterControl/utils/constants.ts index 1473bc852aa7..24948c7dc342 100644 --- a/superset-frontend/src/explore/components/controls/DateFilterControl/utils/constants.ts +++ b/superset-frontend/src/explore/components/controls/DateFilterControl/utils/constants.ts @@ -22,7 +22,7 @@ import { SelectOptionType, PreviousCalendarWeek, PreviousCalendarMonth, - PreviousQuarter, + PreviousCalendarQuarter, PreviousCalendarYear, CommonRangeType, CalendarRangeType, @@ -57,7 +57,7 @@ export const COMMON_RANGE_VALUES_SET = new Set( export const CALENDAR_RANGE_OPTIONS: SelectOptionType[] = [ { value: PreviousCalendarWeek, label: t('previous calendar week') }, { value: PreviousCalendarMonth, label: t('previous calendar month') }, - { value: PreviousQuarter, label: t('previous quarter') }, + { value: PreviousCalendarQuarter, label: t('previous calendar quarter') }, { value: PreviousCalendarYear, label: t('previous calendar year') }, ]; export const CALENDAR_RANGE_VALUES_SET = new Set( @@ -121,7 +121,7 @@ export const COMMON_RANGE_SET: Set = new Set([ export const CALENDAR_RANGE_SET: Set = new Set([ PreviousCalendarWeek, PreviousCalendarMonth, - PreviousQuarter, + PreviousCalendarQuarter, PreviousCalendarYear, ]);