mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-15 01:12:56 +03:00
This commit is contained in:
parent
3f79ad2809
commit
35d0e8f3f3
@ -16,7 +16,7 @@ import {
|
||||
setLimit,
|
||||
addOrder,
|
||||
} from './FilterActions';
|
||||
import { ordinalColSort } from '../utils';
|
||||
import { ordinalColSort, convertDateTimeToLocale } from '../utils';
|
||||
import '../TableCommon/ReactTableFix.css';
|
||||
|
||||
const ViewRows = ({
|
||||
@ -112,7 +112,7 @@ const ViewRows = ({
|
||||
}
|
||||
let content = row[col] === undefined ? 'NULL' : row[col].toString();
|
||||
if (col === 'created_at') {
|
||||
content = new Date(row[col]).toUTCString();
|
||||
content = convertDateTimeToLocale(row[col]);
|
||||
}
|
||||
if (col === 'event_id') {
|
||||
content = row.id.toString();
|
||||
@ -282,7 +282,7 @@ const ViewRows = ({
|
||||
return status;
|
||||
}
|
||||
if (col === 'created_at') {
|
||||
const formattedDate = new Date(r.created_at).toUTCString();
|
||||
const formattedDate = convertDateTimeToLocale(r.created_at);
|
||||
return formattedDate;
|
||||
}
|
||||
const content =
|
||||
|
@ -17,7 +17,7 @@ import {
|
||||
setLimit,
|
||||
addOrder,
|
||||
} from './FilterActions';
|
||||
import { ordinalColSort } from '../utils';
|
||||
import { ordinalColSort, convertDateTimeToLocale } from '../utils';
|
||||
import '../TableCommon/ReactTableFix.css';
|
||||
import * as tooltip from '../Common/Tooltips';
|
||||
import OverlayTrigger from 'react-bootstrap/lib/OverlayTrigger';
|
||||
@ -115,7 +115,7 @@ const ViewRows = ({
|
||||
}
|
||||
let content = row[col] === undefined ? 'NULL' : row[col].toString();
|
||||
if (col === 'created_at') {
|
||||
content = new Date(row[col]).toUTCString();
|
||||
content = convertDateTimeToLocale(row[col]);
|
||||
}
|
||||
if (col === 'event_id') {
|
||||
content = row.id.toString();
|
||||
@ -304,7 +304,7 @@ const ViewRows = ({
|
||||
return status;
|
||||
}
|
||||
if (col === 'created_at') {
|
||||
const formattedDate = new Date(r.created_at).toUTCString();
|
||||
const formattedDate = convertDateTimeToLocale(r.created_at);
|
||||
return formattedDate;
|
||||
}
|
||||
const content =
|
||||
|
@ -16,7 +16,7 @@ import {
|
||||
setLimit,
|
||||
addOrder,
|
||||
} from './FilterActions';
|
||||
import { ordinalColSort } from '../utils';
|
||||
import { ordinalColSort, convertDateTimeToLocale } from '../utils';
|
||||
import Spinner from '../../../Common/Spinner/Spinner';
|
||||
import '../TableCommon/ReactTableFix.css';
|
||||
|
||||
@ -114,7 +114,7 @@ const ViewRows = ({
|
||||
}
|
||||
let content = row[col] === undefined ? 'NULL' : row[col].toString();
|
||||
if (col === 'created_at') {
|
||||
content = new Date(row[col]).toUTCString();
|
||||
content = convertDateTimeToLocale(row[col]);
|
||||
}
|
||||
return <div className={conditionalClassname}>{content}</div>;
|
||||
};
|
||||
@ -288,7 +288,7 @@ const ViewRows = ({
|
||||
return status;
|
||||
}
|
||||
if (col === 'created_at') {
|
||||
const formattedDate = new Date(r.created_at).toUTCString();
|
||||
const formattedDate = convertDateTimeToLocale(row[col]);
|
||||
return formattedDate;
|
||||
}
|
||||
const content =
|
||||
|
@ -27,6 +27,7 @@ import {
|
||||
} from './LogActions';
|
||||
import * as tooltip from '../Common/Tooltips';
|
||||
import OverlayTrigger from 'react-bootstrap/lib/OverlayTrigger';
|
||||
import { convertDateTimeToLocale } from '../utils';
|
||||
|
||||
class StreamingLogs extends Component {
|
||||
constructor(props) {
|
||||
@ -221,7 +222,7 @@ class StreamingLogs extends Component {
|
||||
return <div className={conditionalClassname}>{r.id}</div>;
|
||||
}
|
||||
if (col === 'created_at') {
|
||||
const formattedDate = new Date(r.created_at).toUTCString();
|
||||
const formattedDate = convertDateTimeToLocale(r.created_at);
|
||||
return <div className={conditionalClassname}>{formattedDate}</div>;
|
||||
}
|
||||
if (col === 'operation') {
|
||||
|
@ -132,6 +132,22 @@ const getTableColumns = tableSchema => {
|
||||
return [];
|
||||
};
|
||||
|
||||
const convertDateTimeToLocale = dateTime => {
|
||||
const options = {
|
||||
hourCycle: 'h24',
|
||||
day: 'numeric',
|
||||
hour: '2-digit',
|
||||
minute: '2-digit',
|
||||
month: 'short',
|
||||
second: '2-digit',
|
||||
timeZoneName: 'short',
|
||||
weekday: 'short',
|
||||
year: 'numeric',
|
||||
};
|
||||
|
||||
return new Date(dateTime + 'Z').toLocaleString('en-US', options);
|
||||
};
|
||||
|
||||
export {
|
||||
ordinalColSort,
|
||||
findTableFromRel,
|
||||
@ -140,4 +156,5 @@ export {
|
||||
getIngForm,
|
||||
escapeRegExp,
|
||||
getTableColumns,
|
||||
convertDateTimeToLocale,
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user