diff --git a/Sources/Subs-Calendar.php b/Sources/Subs-Calendar.php index f4b2cdbf4a..b69ef57047 100644 --- a/Sources/Subs-Calendar.php +++ b/Sources/Subs-Calendar.php @@ -1882,8 +1882,11 @@ function convertDateToEnglish($date) 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat' )); // Find all possible variants of AM and PM for this language. - $replacements[strtolower($txt['time_am'])] = 'AM'; - $replacements[strtolower($txt['time_pm'])] = 'PM'; + if (trim($txt['time_am']) !== '' && trim($txt['time_pm']) !== '') + { + $replacements[strtolower($txt['time_am'])] = 'AM'; + $replacements[strtolower($txt['time_pm'])] = 'PM'; + } if (($am = smf_strftime('%p', strtotime('01:00:00'))) !== 'p' && $am !== false) { $replacements[strtolower($am)] = 'AM';