From: Mathieu Suen Date: Thu, 2 Nov 2023 10:53:25 +0000 (+0100) Subject: SONAR-20721 Improve day picker accessiblity X-Git-Tag: 10.3.0.82913~37 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=f05332a75d430c3b8899c5e4efad56e1d534bf33;p=sonarqube.git SONAR-20721 Improve day picker accessiblity --- diff --git a/server/sonar-web/design-system/src/components/input/DatePickerCustomCalendarNavigation.tsx b/server/sonar-web/design-system/src/components/input/DatePickerCustomCalendarNavigation.tsx index 6ce279b7ae3..92ad29fae01 100644 --- a/server/sonar-web/design-system/src/components/input/DatePickerCustomCalendarNavigation.tsx +++ b/server/sonar-web/design-system/src/components/input/DatePickerCustomCalendarNavigation.tsx @@ -48,6 +48,16 @@ export function CustomCalendarNavigation(props: CaptionProps) { const intl = useIntl(); + const formatChevronLabel = (date?: Date) => { + if (date === undefined) { + return intl.formatMessage({ id: 'disabled_' }); + } + return `${intl.formatDate(date, { month: 'long', format: 'M' })} ${intl.formatDate(date, { + year: 'numeric', + format: 'y', + })}`; + }; + const baseDate = startOfMonth(displayMonth); // reference date const months = range(MONTHS_IN_A_YEAR).map((month) => { @@ -74,8 +84,12 @@ export function CustomCalendarNavigation(props: CaptionProps) {