X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/61cd8fe9d4fe4dfeab443f31bbbc5effa5176765..796a3ce005800d37ef5711b367c926ac720577d5:/src/common/formatters.ts diff --git a/src/common/formatters.ts b/src/common/formatters.ts index 60e6cd59c5..377e78e42a 100644 --- a/src/common/formatters.ts +++ b/src/common/formatters.ts @@ -4,10 +4,16 @@ import { PropertyValue } from "~/models/search-bar"; -export const formatDate = (isoDate?: string | null) => { +export const formatDate = (isoDate?: string | null, utc: boolean = false) => { if (isoDate) { const date = new Date(isoDate); - const text = date.toLocaleString(); + let text: string; + if (utc) { + text = date.toUTCString(); + } + else { + text = date.toLocaleString(); + } return text === 'Invalid Date' ? "(none)" : text; } return "(none)";