Skip to content

Commit 1e4f4cc

Browse files
committed
Fix time display
1 parent a665638 commit 1e4f4cc

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

featherbb/Core/Utils.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,14 @@ public static function formatTime($timestamp, $dateOnly = false, $dateFormat = n
9191

9292
if (is_null($dateFormat)) {
9393
$availableDateFormats = Container::get('forum_date_formats');
94-
$dateFormat = $availableDateFormats[User::getPref('date_format')];
94+
$userFormat = User::getPref('date_format');
95+
$dateFormat = isset($availableDateFormats[$userFormat]) ? $availableDateFormats[$userFormat] : $userFormat;
9596
}
9697

9798
if (is_null($timeFormat)) {
9899
$availableTimeFormats = Container::get('forum_time_formats');
99-
$timeFormat = $availableTimeFormats[User::getPref('time_format')];
100+
$userFormat = User::getPref('time_format');
101+
$timeFormat = isset($availableTimeFormats[$userFormat]) ? $availableTimeFormats[$userFormat] : $userFormat;
100102
}
101103

102104
$date = gmdate($dateFormat, $timestamp);

0 commit comments

Comments
 (0)