Skip to content

Commit

Permalink
Fix issue #77
Browse files Browse the repository at this point in the history
  • Loading branch information
georgmaisser committed Mar 12, 2024
1 parent 38d5205 commit 9138dde
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 48 deletions.
26 changes: 2 additions & 24 deletions classes/tables/table_games.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,31 +98,9 @@ public function col_playerbid($game) {
*/
public function col_timemodified($game) {
if ($game->timemodified) {
if (current_language() === 'de') {
$monthnamesde = [
1 => "Januar",
2 => "Februar",
3 => "März",
4 => "April",
5 => "Mai",
6 => "Juni",
7 => "Juli",
8 => "August",
9 => "September",
10 => "Oktober",
11 => "November",
12 => "Dezember",
];
// Now build the German date string.
$name = date("d. ", $game->timemodified);
$name .= $monthnamesde[date("n", $game->timemodified)];
$name .= date(" Y, H:i:s", $game->timemodified);
} else {
$name = date("F j, Y, g:i:s a", $game->timemodified);
}

return $name;
return userdate($game->timemodified, get_string('strftimedatetime', 'core_langconfig'));
}
return '';
}

/**
Expand Down
26 changes: 2 additions & 24 deletions classes/tables/table_highscores.php
Original file line number Diff line number Diff line change
Expand Up @@ -187,30 +187,8 @@ public function col_qcpercentage(stdClass $highscoreentry) {
*/
public function col_timemodified(stdClass $game) {
if ($game->timemodified) {
if (current_language() === 'de') {
$monthnamesde = [
1 => "Januar",
2 => "Februar",
3 => "März",
4 => "April",
5 => "Mai",
6 => "Juni",
7 => "Juli",
8 => "August",
9 => "September",
10 => "Oktober",
11 => "November",
12 => "Dezember",
];
// Now build the German date string.
$name = date("d. ", $game->timemodified);
$name .= $monthnamesde[date("n", $game->timemodified)];
$name .= date(" Y, H:i:s", $game->timemodified);
} else {
$name = date("F j, Y, g:i:s a", $game->timemodified);
}

return $name;
return userdate($game->timemodified, get_string('strftimedatetime', 'core_langconfig'));
}
return '';
}
}

0 comments on commit 9138dde

Please sign in to comment.