From 95a4bac89933eaad820b85371e2409ec8bbccac7 Mon Sep 17 00:00:00 2001 From: Keita Nonaka Date: Wed, 2 Oct 2024 15:16:29 -0700 Subject: [PATCH] fix: remove `stripTimezone` --- webui/react/src/utils/datetime.test.ts | 14 -------------- webui/react/src/utils/datetime.ts | 5 ----- 2 files changed, 19 deletions(-) diff --git a/webui/react/src/utils/datetime.test.ts b/webui/react/src/utils/datetime.test.ts index 51c1ad7e6b0..55d17d7a9f8 100644 --- a/webui/react/src/utils/datetime.test.ts +++ b/webui/react/src/utils/datetime.test.ts @@ -59,18 +59,4 @@ describe('Datetime Utilities', () => { }); }); }); - - describe('stripTimezone', () => { - it('should strip timezone from datetime strings', () => { - const tests = [ - { input: '2021-11-11T00:00:00', output: '2021-11-11T00:00:00' }, - { input: '2021-11-11T00:00:00Z', output: '2021-11-11T00:00:00' }, - { input: '2021-11-11T00:00:00+11:11', output: '2021-11-11T00:00:00' }, - { input: '2021-11-11T00:00:00-05:05', output: '2021-11-11T00:00:00' }, - ]; - tests.forEach((test) => { - expect(utils.stripTimezone(test.input)).toBe(test.output); - }); - }); - }); }); diff --git a/webui/react/src/utils/datetime.ts b/webui/react/src/utils/datetime.ts index 221e8ffbca4..b11a07655cc 100644 --- a/webui/react/src/utils/datetime.ts +++ b/webui/react/src/utils/datetime.ts @@ -56,11 +56,6 @@ export const getDuration = (times: StartEndTimes): number => { export const secondToHour = (seconds: number): number => seconds / 3600; -export const stripTimezone = (datetime: string): string => { - const timezoneRegex = /(Z|(-|\+)\d{2}:\d{2})$/; - return datetime.replace(timezoneRegex, ''); -}; - export const getDurationInEnglish = (record: BulkExperimentItem): string => { const duration = getDuration(record); const options = {