From 662f72a006ba9cec0cd3db4974d3244926bda190 Mon Sep 17 00:00:00 2001 From: leosw Date: Tue, 1 Feb 2022 22:39:26 +0100 Subject: [PATCH] Fix dates in php < 8.0.0 --- includes/session.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/includes/session.php b/includes/session.php index 73929f1..32572b3 100755 --- a/includes/session.php +++ b/includes/session.php @@ -26,7 +26,11 @@ else { $user->rank = "visitor"; // All users are visitors } -$user->date_format = new IntlDateFormatter($config['locale'], IntlDateFormatter::RELATIVE_LONG, IntlDateFormatter::NONE, $config['timezone']); +if (PHP_VERSION_ID < 80000) { + $user->date_format = new IntlDateFormatter($config['locale'], IntlDateFormatter::LONG, IntlDateFormatter::NONE, $config['timezone']); +} else { + $user->date_format = new IntlDateFormatter($config['locale'], IntlDateFormatter::RELATIVE_LONG, IntlDateFormatter::NONE, $config['timezone']); +} $user->datetime_format = new IntlDateFormatter($config['locale'], IntlDateFormatter::LONG, IntlDateFormatter::SHORT, $config['timezone']); $user->datetimeshort_format = new IntlDateFormatter($config['locale'], IntlDateFormatter::SHORT, IntlDateFormatter::SHORT, $config['timezone']);