Skip to content

Commit

Permalink
fix: remove stripTimezone
Browse files Browse the repository at this point in the history
  • Loading branch information
keita-determined committed Oct 2, 2024
1 parent 66343d1 commit 95a4bac
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 19 deletions.
14 changes: 0 additions & 14 deletions webui/react/src/utils/datetime.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
});
});
});
5 changes: 0 additions & 5 deletions webui/react/src/utils/datetime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down

0 comments on commit 95a4bac

Please sign in to comment.