fixed bug to show date only mode of date time string.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user