From 3973271d95019b4341bf1d7bdd333fd2275d11e4 Mon Sep 17 00:00:00 2001 From: svetlagasheva Date: Fri, 11 Oct 2019 18:11:48 +0300 Subject: [PATCH] handle the case for today notification --- .../NotificationsList/Notification/Notification.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/common/NavBar/NotificationsMenu/NotificationsList/Notification/Notification.js b/src/common/NavBar/NotificationsMenu/NotificationsList/Notification/Notification.js index cd3f1cb1e..2f442f088 100644 --- a/src/common/NavBar/NotificationsMenu/NotificationsList/Notification/Notification.js +++ b/src/common/NavBar/NotificationsMenu/NotificationsList/Notification/Notification.js @@ -16,6 +16,7 @@ const ICON_FOR_TYPE = Object.assign(Object.create(null), { const Notification = ({ className, id, type, name, logo, poster, season, episode, released, posterThumbnail, onClick }) => { const [aLogo, setALogo] = React.useState(logo); + const daysAgo = Math.floor(Math.abs((Date.now() - released) / (24 * 60 * 60 * 1000))); return (