From 1717afbe39c517d2157960a8a4244edb1a515977 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Thu, 20 Jan 2022 12:25:53 +0100 Subject: [PATCH] event-history.phtml: Use `Intl` to localize dates instead of `strftime`, which is deprecated --- .../application/views/scripts/partials/event-history.phtml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/monitoring/application/views/scripts/partials/event-history.phtml b/modules/monitoring/application/views/scripts/partials/event-history.phtml index cc1862362..b2fc8857b 100644 --- a/modules/monitoring/application/views/scripts/partials/event-history.phtml +++ b/modules/monitoring/application/views/scripts/partials/event-history.phtml @@ -30,7 +30,7 @@ $history->limit($limit * $page); ?>
translate('%A, %B %e, %Y', 'date.verbose'); +$dateFormatter = new IntlDateFormatter(setlocale(LC_TIME, 0), IntlDateFormatter::FULL, IntlDateFormatter::LONG); $lastDate = null; $flappingMsg = $this->translate('Flapping with a %.2f%% state change rate'); $rowAction = Url::fromPath('monitoring/event/show'); @@ -161,7 +161,7 @@ $rowAction = Url::fromPath('monitoring/event/show'); break; } ?> timestamp); + $currentDate = $dateFormatter->format($event->timestamp); if ($currentDate !== $lastDate): $lastDate = $currentDate; ?>