fixed bug to show date only mode of date time string.

This commit is contained in:
Yoshihiro OKUMURA
2019-06-17 17:20:21 +09:00
parent 0646d26a44
commit 4bc66c7299
@@ -12,10 +12,10 @@ const DateTime = (props: Props) => {
const { date, onlyDate } = props;
const d = moment(new Date(date * 1000));
let format = 'MMM D, Y';
if (typeof onlyDate !== 'undefined' || onlyDate) {
if (typeof onlyDate === 'undefined' || !onlyDate) {
format += ' HH:mm:ss';
}
return <span>{d.format(format)}</span>;
}
export default DateTime;
export default DateTime;