Unverified Commit 5110dc5b authored by Daniel's avatar Daniel Committed by GitHub

Changed date format and message for stats collection info (#45)

parent 9752b675
import * as React from 'react'; import * as React from 'react';
import moment from 'moment-timezone';
import ColumnDescEditableText from '../../../../containers/TableDetail/ColumnDescEditableText'; import ColumnDescEditableText from '../../../../containers/TableDetail/ColumnDescEditableText';
import InfoButton from '../../../common/InfoButton';
import { TableColumn } from '../../types'; import { TableColumn } from '../../types';
// TODO: Use css-modules instead of 'import' // TODO: Use css-modules instead of 'import'
...@@ -36,12 +35,8 @@ class DetailListItem extends React.Component<DetailListItemProps, DetailListItem ...@@ -36,12 +35,8 @@ class DetailListItem extends React.Component<DetailListItemProps, DetailListItem
})); }));
}; };
formatDate = (unixEpochTimeValue) => { formatDate = (unixEpochSeconds) => {
const date = new Date(0); return moment(unixEpochSeconds * 1000).format("MMM DD, YYYY");
date.setSeconds(unixEpochTimeValue);
/* TODO: Internationalization */
return date.toLocaleDateString();
}; };
render() { render() {
...@@ -53,17 +48,15 @@ class DetailListItem extends React.Component<DetailListItemProps, DetailListItem ...@@ -53,17 +48,15 @@ class DetailListItem extends React.Component<DetailListItemProps, DetailListItem
const startDate = isExpandable ? this.formatDate(startEpoch) : null; const startDate = isExpandable ? this.formatDate(startEpoch) : null;
const endDate = isExpandable ? this.formatDate(endEpoch) : null; const endDate = isExpandable ? this.formatDate(endEpoch) : null;
let infoText = 'Stats collected'; let infoText = 'Stats reflect data collected';
if (startDate && endDate) { if (startDate && endDate) {
if (startDate === endDate) { if (startDate === endDate) {
infoText = `${infoText} on ${startDate} partition`; infoText = `${infoText} on ${startDate} only. (daily partition)`;
} } else {
else { infoText = `${infoText} between ${startDate} and ${endDate}.`;
infoText = `${infoText} between ${startDate} and ${endDate}`;
}
} }
else { } else {
infoText = `${infoText} over a recent period of time`; infoText = `${infoText} over a recent period of time.`;
} }
return ( return (
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment