Arvados-DCO-1.1-Signed-off-by: Eric Biagiotti <ebiagiotti@veritasgenetics.com>
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)";
const disp = [];
disp.push(<span><b>{user.email}</b> ({user.username}, {user.uuid})</span>);
if (showCreatedAt) {
- disp.push(<span> created on <b>{formatDate(user.createdAt)}</b></span>);
+ disp.push(<span> created on <b>{formatDate(user.createdAt, true)}</b></span>);
}
return disp;
}