feature/IO-3096-GlobalNotifications - add Dayjs, minor packages on backend

This commit is contained in:
Dave Richer
2025-02-28 12:05:40 -05:00
parent 9b871149ac
commit f6acc1107c
2 changed files with 8 additions and 9 deletions

View File

@@ -79,7 +79,7 @@ export function NotificationCenterContainer({ visible, onClose, bodyshop }) {
__typename: notif.__typename
};
})
.sort((a, b) => day(b.created_at).diff(day(a.created_at)));
.sort((a, b) => new Date(b.created_at) - new Date(a.created_at));
setNotifications(processedNotifications);
setError(null);
}
@@ -115,7 +115,7 @@ export function NotificationCenterContainer({ visible, onClose, bodyshop }) {
const handleMarkAllRead = useCallback(() => {
markAllNotificationsRead()
.then(() => {
const timestamp = day().toISOString();
const timestamp = new Date().toISOString();
setNotifications((prev) => {
const updatedNotifications = prev.map((notif) =>
notif.read === null && notif.associationid === userAssociationId
@@ -137,7 +137,7 @@ export function NotificationCenterContainer({ visible, onClose, bodyshop }) {
variables: { id: notificationId }
})
.then(() => {
const timestamp = day().toISOString();
const timestamp = new Date().toISOString();
setNotifications((prev) => {
return prev.map((notif) =>
notif.id === notificationId && !notif.read ? { ...notif, read: timestamp } : notif