From aef8d9e6f14c21be83b6a3a202526a3f954310c4 Mon Sep 17 00:00:00 2001 From: Jun Pataleta Date: Mon, 18 Aug 2025 19:28:32 +0800 Subject: [PATCH 1/2] MDL-72511 calendar: Fix month_mini navigation * Hide arrow icons from assistive technologies. * Add a more sensible aria-label for the previous/next month links. --- calendar/templates/month_mini.mustache | 6 ++++-- lang/en/calendar.php | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/calendar/templates/month_mini.mustache b/calendar/templates/month_mini.mustache index 54909c2f99c..ee3742c6ccd 100644 --- a/calendar/templates/month_mini.mustache +++ b/calendar/templates/month_mini.mustache @@ -51,8 +51,9 @@ }} title="{{#str}}monthprev, calendar{{/str}}"{{! }} data-year="{{previousperiod.year}}"{{! }} data-month="{{previousperiod.mon}}"{{! + }} aria-label="{{#str}}monthprevwithname, calendar, {{previousperiodname}}{{/str}}" {{! }}> - {{{larrow}}} + | @@ -65,8 +66,9 @@ }} title="{{#str}}monthnext, calendar{{/str}}"{{! }} data-year="{{nextperiod.year}}"{{! }} data-month="{{nextperiod.mon}}"{{! + }} aria-label="{{#str}}monthnextwithname, calendar, {{nextperiodname}}{{/str}}" {{! }}> - {{{rarrow}}} + {{/includenavigation}} {{^includenavigation}} diff --git a/lang/en/calendar.php b/lang/en/calendar.php index 2dd52b91723..ad163e7984a 100644 --- a/lang/en/calendar.php +++ b/lang/en/calendar.php @@ -184,7 +184,9 @@ $string['mon'] = 'Mon'; $string['monday'] = 'Monday'; $string['monthly'] = 'Monthly'; $string['monthnext'] = 'Next month'; +$string['monthnextwithname'] = 'Next month: {$a}'; $string['monthprev'] = 'Previous month'; +$string['monthprevwithname'] = 'Previous month: {$a}'; $string['monththis'] = 'This month'; $string['more'] = 'More'; $string['moreevents'] = '{$a} more'; From 2395392c99c972a2592660bf0cf97f62316e0bb3 Mon Sep 17 00:00:00 2001 From: Jun Pataleta Date: Tue, 19 Aug 2025 10:55:29 +0800 Subject: [PATCH 2/2] MDL-72511 calendar: Better calendar navigation labelling * Make the accessible labels of the previous and next month links more informative by indicating the name of the previous/next months. * Make titles on the previous and next month links reflect the actual month and show titles only when the calendar is rendered within a block. This is because the title attribute is only used for the sake for sighted users who may need to know the meaning of the previous/next month links, especially when the calendar is displayed in compact form where the previous/next month name is not shown. --- calendar/templates/month_mini.mustache | 4 ++-- calendar/templates/month_navigation.mustache | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/calendar/templates/month_mini.mustache b/calendar/templates/month_mini.mustache index ee3742c6ccd..af4ee7803c7 100644 --- a/calendar/templates/month_mini.mustache +++ b/calendar/templates/month_mini.mustache @@ -48,7 +48,7 @@   @@ -56,10 +57,11 @@ {{nextperiodname}}