From 951d7bbb638b469f9bc7097c0e71f3423dbbf72f Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Thu, 9 Jul 2020 12:55:40 -0400 Subject: [PATCH] remove 'show both' date option in DateTime --- ui/component/dateTime/view.jsx | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/ui/component/dateTime/view.jsx b/ui/component/dateTime/view.jsx index 07d2fd0ca..28cd814ac 100644 --- a/ui/component/dateTime/view.jsx +++ b/ui/component/dateTime/view.jsx @@ -12,7 +12,6 @@ type Props = { class DateTime extends React.PureComponent { static SHOW_DATE = 'date'; static SHOW_TIME = 'time'; - static SHOW_BOTH = 'both'; static getTimeAgoStr(date: any) { const suffixList = ['years', 'months', 'days', 'hours', 'minutes', 'seconds', '']; @@ -41,8 +40,7 @@ class DateTime extends React.PureComponent { } render() { - const { date, timeAgo } = this.props; - const show = this.props.show || DateTime.SHOW_BOTH; + const { date, timeAgo, show } = this.props; if (timeAgo) { if (!date) { @@ -54,9 +52,8 @@ class DateTime extends React.PureComponent { return ( - {date && (show === DateTime.SHOW_BOTH || show === DateTime.SHOW_DATE) && moment(date).format('MMMM Do, YYYY')} - {show === DateTime.SHOW_BOTH && ' '} - {date && (show === DateTime.SHOW_BOTH || show === DateTime.SHOW_TIME) && date.toLocaleTimeString()} + {date && show === DateTime.SHOW_DATE && moment(date).format('MMMM Do, YYYY')} + {date && show === DateTime.SHOW_TIME && moment(date).format('hh:mm A')} {!date && '...'} );