From 9bc1bf400bf978d9bc1d8cac203339e94b94f746 Mon Sep 17 00:00:00 2001 From: Ong Guan Hong Malcolm <65110268+m0nggh@users.noreply.github.com> Date: Wed, 27 Nov 2024 15:09:00 +0800 Subject: [PATCH] chore: remove yy/LL/dd formatter date format (#798) ## Problem Realised that we have conflicting formats `dd/LL/yy` vs `yy/LL/dd` and it could pose as a problem when people use this format later in a delay step ## Solution Remove the `yy/LL/dd` datetime format ## Regression test - Check that prod doesn't have any steps that uses this date format thankfully (only 2 but both are deleted) Simple query: ``` SELECT * FROM steps WHERE key = 'dateTime' and parameters::text ilike '%"formatDateTimeToFormat": "yy/LL/dd"%'' ``` --- .../src/apps/formatter/__tests__/date-time.format.test.ts | 1 - .../date-time/transforms/convert-date-time/fields.ts | 6 ------ 2 files changed, 7 deletions(-) diff --git a/packages/backend/src/apps/formatter/__tests__/date-time.format.test.ts b/packages/backend/src/apps/formatter/__tests__/date-time.format.test.ts index 229508bae..b184b89c9 100644 --- a/packages/backend/src/apps/formatter/__tests__/date-time.format.test.ts +++ b/packages/backend/src/apps/formatter/__tests__/date-time.format.test.ts @@ -35,7 +35,6 @@ describe('convert date time', () => { { toFormat: 'dd/LL/yyyy', expectedResult: '01/04/2024' }, { toFormat: 'dd LLL yyyy', expectedResult: '01 Apr 2024' }, { toFormat: 'dd LLLL yyyy', expectedResult: '01 April 2024' }, - { toFormat: 'yy/LL/dd', expectedResult: '24/04/01' }, { toFormat: 'yyyy/LL/dd', expectedResult: '2024/04/01' }, { toFormat: 'hh:mm a', expectedResult: '12:05 pm' }, { toFormat: 'hh:mm:ss a', expectedResult: '12:05:10 pm' }, diff --git a/packages/backend/src/apps/formatter/actions/date-time/transforms/convert-date-time/fields.ts b/packages/backend/src/apps/formatter/actions/date-time/transforms/convert-date-time/fields.ts index ef262dfe4..892a1f99d 100644 --- a/packages/backend/src/apps/formatter/actions/date-time/transforms/convert-date-time/fields.ts +++ b/packages/backend/src/apps/formatter/actions/date-time/transforms/convert-date-time/fields.ts @@ -9,7 +9,6 @@ const formatStringsEnum = z.enum([ 'dd/LL/yyyy', 'dd LLL yyyy', 'dd LLLL yyyy', - 'yy/LL/dd', 'yyyy/LL/dd', 'hh:mm a', 'hh:mm:ss a', @@ -49,11 +48,6 @@ export const field = { description: '02 January 2006', value: ensureZodEnumValue(formatStringsEnum, 'dd LLLL yyyy'), }, - { - label: 'YY/MM/DD', - description: '24/01/22', - value: ensureZodEnumValue(formatStringsEnum, 'yy/LL/dd'), - }, { label: 'YYYY/MM/DD', description: '2024/01/22',