projects
/
arvados-workbench2.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
15424: Incorporate contents of WelcomePageHTML in login panel
[arvados-workbench2.git]
/
src
/
common
/
formatters.ts
diff --git
a/src/common/formatters.ts
b/src/common/formatters.ts
index 60e6cd59c53e284a929cd6143c618020537ffd3a..377e78e42a8678dae93980549bda9c6a10fc8020 100644
(file)
--- a/
src/common/formatters.ts
+++ b/
src/common/formatters.ts
@@
-4,10
+4,16
@@
import { PropertyValue } from "~/models/search-bar";
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);
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)";
return text === 'Invalid Date' ? "(none)" : text;
}
return "(none)";