Skip to content

Commit

Permalink
Merge pull request #61 from JAK0TA/refactor-handle-typing-correct
Browse files Browse the repository at this point in the history
Refactor: handle typing correct
  • Loading branch information
KrohnMi authored Oct 21, 2024
2 parents c387747 + 4c5c475 commit 73b01ea
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Classes/Utility/DateUtility.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,13 @@ public static function calculateRelativeDate(int $timestamp) {
}
$diff = round($diff);
$out = 'vor '.$diff.' '.$strTime[$i];

// Add appropriate pluralization for German
if ($diff > 1) {
if ('e' == $strTime[$i][-1]) {
$out = $out.'n';
if (substr($strTime[$i], -1) === 'e') {
$out .= 'n';
} else {
$out = $out.'en';
$out .= 'en';
}
}

Expand Down

0 comments on commit 73b01ea

Please sign in to comment.