diff --git a/ui/src/app/applications/components/pod-logs-viewer/since-selector.tsx b/ui/src/app/applications/components/pod-logs-viewer/since-seconds-selector.tsx similarity index 100% rename from ui/src/app/applications/components/pod-logs-viewer/since-selector.tsx rename to ui/src/app/applications/components/pod-logs-viewer/since-seconds-selector.tsx diff --git a/ui/src/app/shared/services/since.test.ts b/ui/src/app/shared/services/since.test.ts deleted file mode 100644 index ed37adc8994f2..0000000000000 --- a/ui/src/app/shared/services/since.test.ts +++ /dev/null @@ -1,11 +0,0 @@ -import {sinceSeconds} from "./since"; - -test('sinceSeconds', () => { - const now = new Date(0); - expect(sinceSeconds('min', now)).toBe(0); - expect(sinceSeconds('1m', now)).toBe(0 - 60); - expect(sinceSeconds('5m', now)).toBe(0 - 5 * 60); - expect(sinceSeconds('30m', now)).toBe(0 - 30 * 60); - expect(sinceSeconds('1h', now)).toBe(0 - 60 * 60); - expect(sinceSeconds('4h', now)).toBe(0 - 4 * 60 * 60); -}) \ No newline at end of file diff --git a/ui/src/app/shared/services/since.ts b/ui/src/app/shared/services/since.ts deleted file mode 100644 index 1538109ab4e5b..0000000000000 --- a/ui/src/app/shared/services/since.ts +++ /dev/null @@ -1,24 +0,0 @@ -export type Since = 'forever' | '1m ago' | '5m ago' | '30m ago' | '1h ago' | '4h ago'; - -const sinceToMins = (value: Since) => { - switch (value) { - case '1m ago': - return 1; - case '5m ago': - return 5; - case '30m ago': - return 30; - case '1h ago': - return 60; - case '4h ago': - return 4 * 60; - default: - return 0; - } -}; - -export const sinceSeconds = (since: Since, now = new Date()): number => { - const mins = sinceToMins(since); - const date = mins === 0 ? new Date(0) : new Date(now.getTime() - mins * 60 * 1000); - return date.getTime() / 1000; -};