Skip to content

Commit

Permalink
Fixes issue for languages with empty $txt['am'] and $txt['pm'] strings
Browse files Browse the repository at this point in the history
Signed-off-by: Jon Stovell <jonstovell@gmail.com>
  • Loading branch information
Sesquipedalian committed May 21, 2024
1 parent b862808 commit 6ea8348
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Sources/Subs-Calendar.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down

0 comments on commit 6ea8348

Please sign in to comment.