From b12027f162d1c06d783d9e08cfc8f12bfe45705f Mon Sep 17 00:00:00 2001 From: Angel Fernando Quiroz Campos Date: Wed, 6 Mar 2019 13:54:50 -0500 Subject: [PATCH] Chat: fix calculate time when refresing chat windows --- main/inc/lib/chat.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/inc/lib/chat.lib.php b/main/inc/lib/chat.lib.php index 1ef081623a..31d3ff6b88 100755 --- a/main/inc/lib/chat.lib.php +++ b/main/inc/lib/chat.lib.php @@ -308,7 +308,7 @@ class Chat extends Model if (!empty($_SESSION['openChatBoxes'])) { foreach ($_SESSION['openChatBoxes'] as $userId => $time) { if (!isset($_SESSION['tsChatBoxes'][$userId])) { - $now = time() - $time; + $now = is_string($time) ? time() - strtotime($time) : time() - $time; $time = api_convert_and_format_date($time, DATE_TIME_FORMAT_SHORT_TIME_FIRST); $message = sprintf(get_lang('SentAtX'), $time);