From 10f40c9dbbecf85958bb687ba7676241d9f28b5b Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Fri, 28 Aug 2020 11:59:37 +0200 Subject: [PATCH] * Notifications: Fix notifications displayed time was not base on user timezone --- notifications/inc/class.notifications_ajax.inc.php | 4 ++-- notifications/inc/class.notifications_popup.inc.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/notifications/inc/class.notifications_ajax.inc.php b/notifications/inc/class.notifications_ajax.inc.php index 0930a8a125..6b68196356 100644 --- a/notifications/inc/class.notifications_ajax.inc.php +++ b/notifications/inc/class.notifications_ajax.inc.php @@ -210,8 +210,8 @@ class notifications_ajax { 'id' => $notification['notify_id'], 'message' => $notification['notify_message'], 'status' => $notification['notify_status'], - 'created' => Api\DateTime::to($notification['notify_created']), - 'current' => new DateTime(), + 'created' => Api\DateTime::server2user($notification['notify_created']), + 'current' => new Api\DateTime('now'), 'actions' => is_array($actions)?$actions:NULL, 'extra_data' => ($data['data'] ? $data['data'] : array()) ); diff --git a/notifications/inc/class.notifications_popup.inc.php b/notifications/inc/class.notifications_popup.inc.php index 7b0e9850fc..49b848606c 100644 --- a/notifications/inc/class.notifications_popup.inc.php +++ b/notifications/inc/class.notifications_popup.inc.php @@ -161,8 +161,8 @@ class notifications_popup implements notifications_iface { 'id' => $notification['notify_id'], 'message' => $notification['notify_message'], 'status' => $notification['notify_status'], - 'created' => Api\DateTime::to($notification['notify_created']), - 'current' => new DateTime(), + 'created' => Api\DateTime::server2user($notification['notify_created']), + 'current' => new Api\DateTime('now'), 'actions' => is_array($actions)?$actions:NULL, 'extra_data' => ($data['data'] ? $data['data'] : array()) );