Skip to content

Commit 8ba8f7b

Browse files
committed
remove reformatUtcTimestamp() as oblsolete
1 parent 8a7bf70 commit 8ba8f7b

File tree

3 files changed

+0
-36
lines changed

3 files changed

+0
-36
lines changed

packages/cubejs-backend-shared/src/time.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,6 @@ export const localTimestampToUtc = (timezone: string, timestampFormat: string, t
225225
return moment.tz(timestamp, timezone).utc().format(timestampFormat);
226226
};
227227

228-
export const reformatUtcTimestamp = (timestampFormat: string, timestamp: string): string => moment.utc(timestamp).format(timestampFormat);
229-
230228
/**
231229
* Takes timestamp in UTC, shift it into provided timezone and returns the corresponding timestamp in UTC
232230
*/

packages/cubejs-backend-shared/test/time.test.ts

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import {
88
utcToLocalTimeZone,
99
addSecondsToLocalTimestamp,
1010
reformatInIsoLocal,
11-
reformatUtcTimestamp,
1211
} from '../src';
1312

1413
describe('timeSeries', () => {
@@ -530,35 +529,3 @@ describe('reformatInIsoLocal', () => {
530529
expect(reformatInIsoLocal(timestamp)).toBe(expected);
531530
});
532531
});
533-
534-
describe('reformatUtcTimestamp', () => {
535-
it('should format timestamp to YYYY-MM-DDTHH:mm:ss.SSS', () => {
536-
expect(reformatUtcTimestamp('YYYY-MM-DDTHH:mm:ss.SSS', '2025-02-28T12:34:56Z'))
537-
.toBe('2025-02-28T12:34:56.000');
538-
});
539-
540-
it('should format timestamp to YYYY-MM-DDTHH:mm:ss', () => {
541-
expect(reformatUtcTimestamp('YYYY-MM-DDTHH:mm:ss', '2025-02-28T12:34:56Z'))
542-
.toBe('2025-02-28T12:34:56');
543-
});
544-
545-
it('should format timestamp to YYYY-MM-DD HH:mm:ss.SSS', () => {
546-
expect(reformatUtcTimestamp('YYYY-MM-DD HH:mm:ss.SSS', '2025-02-28T12:34:56Z'))
547-
.toBe('2025-02-28 12:34:56.000');
548-
});
549-
550-
it('should format timestamp to YYYY-MM-DD HH:mm:ss', () => {
551-
expect(reformatUtcTimestamp('YYYY-MM-DD HH:mm:ss', '2025-02-28T12:34:56Z'))
552-
.toBe('2025-02-28 12:34:56');
553-
});
554-
555-
it('should handle timestamps with milliseconds', () => {
556-
expect(reformatUtcTimestamp('YYYY-MM-DDTHH:mm:ss.SSS', '2025-02-28T12:34:56.789Z'))
557-
.toBe('2025-02-28T12:34:56.789');
558-
});
559-
560-
it('should handle timestamps without timezone info', () => {
561-
expect(reformatUtcTimestamp('YYYY-MM-DDTHH:mm:ss.SSS', '2025-02-28 12:34:56'))
562-
.toBe('2025-02-28T12:34:56.000');
563-
});
564-
});

packages/cubejs-query-orchestrator/src/orchestrator/PreAggregationPartitionRangeLoader.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import {
1010
timeSeries,
1111
localTimestampToUtc,
1212
parseLocalDate,
13-
reformatUtcTimestamp,
1413
} from '@cubejs-backend/shared';
1514
import { InlineTable, TableStructure } from '@cubejs-backend/base-driver';
1615
import { DriverFactory } from './DriverFactory';

0 commit comments

Comments
 (0)