diff --git a/calendar/classes/output/humandate.php b/calendar/classes/output/humandate.php index 295aaa93c26..3c757033d67 100644 --- a/calendar/classes/output/humandate.php +++ b/calendar/classes/output/humandate.php @@ -265,11 +265,23 @@ class humandate implements renderable, templatable { private function format_relative_date(): ?string { $usertimestamp = $this->get_user_date($this->datetime->getTimestamp()); if ($usertimestamp == $this->get_user_date($this->clock->now()->getTimestamp())) { - $format = get_string('strftimerelativetoday', 'langconfig'); + $format = get_string( + 'timerelativetoday', + 'calendar', + get_string('strftimedateshort', 'langconfig') + ); } else if ($usertimestamp == $this->get_user_date(strtotime('yesterday', $this->clock->now()->getTimestamp()))) { - $format = get_string('strftimerelativeyesterday', 'langconfig'); + $format = get_string( + 'timerelativeyesterday', + 'calendar', + get_string('strftimedateshort', 'langconfig') + ); } else if ($usertimestamp == $this->get_user_date(strtotime('tomorrow', $this->clock->now()->getTimestamp()))) { - $format = get_string('strftimerelativetomorrow', 'langconfig'); + $format = get_string( + 'timerelativetomorrow', + 'calendar', + get_string('strftimedateshort', 'langconfig') + ); } else { return null; } diff --git a/lang/en/calendar.php b/lang/en/calendar.php index 694efe548bf..a68bc3e0042 100644 --- a/lang/en/calendar.php +++ b/lang/en/calendar.php @@ -245,6 +245,9 @@ $string['subscriptionsource'] = 'Event source: {$a}'; $string['subscriptionupdated'] = 'The \'{$a}\' calendar subscription has been updated'; $string['sun'] = 'Sun'; $string['sunday'] = 'Sunday'; +$string['timerelativetoday'] = 'Today, {$a}'; +$string['timerelativetomorrow'] = 'Tomorrow, {$a}'; +$string['timerelativeyesterday'] = 'Yesterday, {$a}'; $string['thu'] = 'Thu'; $string['thursday'] = 'Thursday'; $string['timeformat_12'] = '12-hour (am/pm)'; diff --git a/lang/en/langconfig.php b/lang/en/langconfig.php index f5a099cf1f9..5b68fdd9ebc 100644 --- a/lang/en/langconfig.php +++ b/lang/en/langconfig.php @@ -189,9 +189,6 @@ $string['strftimemonth'] = '%B'; $string['strftimemonthyear'] = '%B %Y'; $string['strftimerecent'] = '%d %b, %H:%M'; $string['strftimerecentfull'] = '%a, %d %b %Y, %I:%M %p'; -$string['strftimerelativetoday'] = 'Today, %d %B'; -$string['strftimerelativetomorrow'] = 'Tomorrow, %d %B'; -$string['strftimerelativeyesterday'] = 'Yesterday, %d %B'; $string['strftimetime'] = '%I:%M %p'; $string['strftimetime12'] = '%I:%M %p'; $string['strftimetime24'] = '%H:%M';