diff --git a/src/components/notifications/ui-notification-toast.tsx b/src/components/notifications/ui-notification-toast.tsx index ec2979a6f..786eff28b 100644 --- a/src/components/notifications/ui-notification-toast.tsx +++ b/src/components/notifications/ui-notification-toast.tsx @@ -16,6 +16,7 @@ import { cypressId } from '../../utils/cypress-attribute' import { useEffectOnce, useInterval } from 'react-use' import { dismissUiNotification } from '../../redux/ui-notifications/methods' import styles from './notifications.module.scss' +import { DateTime } from 'luxon' const STEPS_PER_SECOND = 10 const log = new Logger('UiNotificationToast') @@ -89,6 +90,8 @@ export const UiNotificationToast: React.FC = ({ }) }, [contentI18nKey, contentI18nOptions, t]) + const formattedDate = useMemo(() => DateTime.fromSeconds(date).toRelative({ style: 'short' }), [date]) + return ( @@ -98,7 +101,7 @@ export const UiNotificationToast: React.FC = ({ - {date.toRelative({ style: 'short' })} + {formattedDate} {contentDom}