Calendar: Add labels for next/previous month (#89019)

add labels for next/previous month
This commit is contained in:
Ashley Harrison 2024-06-11 11:49:02 +01:00 committed by GitHub
parent 09e74acc94
commit 09dfdef378
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 7 additions and 0 deletions

View File

@ -5,6 +5,7 @@ import Calendar from 'react-calendar';
import { GrafanaTheme2, dateTimeParse, DateTime, TimeZone } from '@grafana/data'; import { GrafanaTheme2, dateTimeParse, DateTime, TimeZone } from '@grafana/data';
import { useStyles2 } from '../../../themes'; import { useStyles2 } from '../../../themes';
import { t } from '../../../utils/i18n';
import { Icon } from '../../Icon/Icon'; import { Icon } from '../../Icon/Icon';
import { adjustDateForReactCalendar } from '../utils/adjustDateForReactCalendar'; import { adjustDateForReactCalendar } from '../utils/adjustDateForReactCalendar';
@ -24,7 +25,9 @@ export function Body({ onChange, from, to, timeZone }: TimePickerCalendarProps)
tileClassName={styles.title} tileClassName={styles.title}
value={value} value={value}
nextLabel={<Icon name="angle-right" />} nextLabel={<Icon name="angle-right" />}
nextAriaLabel={t('time-picker.calendar.next-month', 'Next month')}
prevLabel={<Icon name="angle-left" />} prevLabel={<Icon name="angle-left" />}
prevAriaLabel={t('time-picker.calendar.previous-month', 'Previous month')}
onChange={onCalendarChange} onChange={onCalendarChange}
locale="en" locale="en"
/> />

View File

@ -1744,6 +1744,8 @@
"apply-button": "Apply time range", "apply-button": "Apply time range",
"cancel-button": "Cancel", "cancel-button": "Cancel",
"close": "Close calendar", "close": "Close calendar",
"next-month": "Next month",
"previous-month": "Previous month",
"select-time": "Select a time range" "select-time": "Select a time range"
}, },
"content": { "content": {

View File

@ -1744,6 +1744,8 @@
"apply-button": "Åppľy ŧįmę řäʼnģę", "apply-button": "Åppľy ŧįmę řäʼnģę",
"cancel-button": "Cäʼnčęľ", "cancel-button": "Cäʼnčęľ",
"close": "Cľőşę čäľęʼnđäř", "close": "Cľőşę čäľęʼnđäř",
"next-month": "Ńęχŧ mőʼnŧĥ",
"previous-month": "Přęvįőūş mőʼnŧĥ",
"select-time": "Ŝęľęčŧ ä ŧįmę řäʼnģę" "select-time": "Ŝęľęčŧ ä ŧįmę řäʼnģę"
}, },
"content": { "content": {