Shun Miyazawa 4 лет назад
Родитель
Сommit
5897b5e0c9

+ 3 - 1
packages/app/src/components/FormattedDistanceDate.jsx

@@ -14,7 +14,7 @@ const FormattedDistanceDate = (props) => {
   const dateFormatted = format(date, 'yyyy/MM/dd HH:mm');
 
   const diff = Math.abs(differenceInSeconds(date, baseDate));
-  if (diff > props.differenceForAvoidingFormat) {
+  if (props.isEnabledShowDate && diff > props.differenceForAvoidingFormat) {
     return <>{dateFormatted}</>;
   }
 
@@ -35,10 +35,12 @@ FormattedDistanceDate.propTypes = {
   // the number(sec) from 'baseDate' to avoid format
   differenceForAvoidingFormat: PropTypes.number,
   isShowTooltip: PropTypes.bool,
+  isEnabledShowDate: PropTypes.bool,
 };
 FormattedDistanceDate.defaultProps = {
   differenceForAvoidingFormat: 86400 * 3,
   isShowTooltip: true,
+  isEnabledShowDate: true,
 };
 
 export default FormattedDistanceDate;

+ 1 - 1
packages/app/src/components/InAppNotification/InAppNotificationElm.tsx

@@ -104,8 +104,8 @@ const InAppNotificationElm = (props: Props): JSX.Element => {
           <FormattedDistanceDate
             id={notification._id}
             date={notification.createdAt}
-            differenceForAvoidingFormat={notification.createdAt}
             isShowTooltip={false}
+            isEnabledShowDate={false}
           />
         </div>
       </div>