File tree Expand file tree Collapse file tree 9 files changed +29
-0
lines changed Expand file tree Collapse file tree 9 files changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import { StyleSheet, View } from 'react-native'
33import { IconButton , useTheme } from 'react-native-paper'
44import DayNames , { dayNamesHeight } from './DayNames'
55import type { DisableWeekDaysType } from './dateUtils'
6+ import { getTranslation } from '../translations/utils'
67
78const buttonContainerHeight = 56
89const buttonContainerMarginTop = 4
@@ -48,6 +49,7 @@ function CalendarHeader({
4849 >
4950 < IconButton
5051 icon = "chevron-left"
52+ accessibilityLabel = { getTranslation ( locale , 'previous' ) }
5153 onPress = { onPrev }
5254 // RN types bug
5355 hasTVPreferredFocus = { undefined }
@@ -63,6 +65,7 @@ function CalendarHeader({
6365 >
6466 < IconButton
6567 icon = "chevron-right"
68+ accessibilityLabel = { getTranslation ( locale , 'next' ) }
6669 onPress = { onNext }
6770 // RN types bug
6871 hasTVPreferredFocus = { undefined }
Original file line number Diff line number Diff line change @@ -79,6 +79,11 @@ export default function DatePickerModalContentHeader(
7979 { allowEditing ? (
8080 < IconButton
8181 icon = { collapsed ? 'pencil' : 'calendar' }
82+ accessibilityLabel = {
83+ collapsed
84+ ? getTranslation ( props . locale , 'typeInDate' )
85+ : getTranslation ( props . locale , 'pickDateFromCalendar' )
86+ }
8287 color = { color }
8388 onPress = { onToggle }
8489 // RN types bug
Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ export default function DatePickerModalHeader(
3131 < Appbar style = { styles . appbarHeader } >
3232 < Appbar . Action
3333 icon = "close"
34+ accessibilityLabel = { getTranslation ( locale , 'close' ) }
3435 onPress = { props . onDismiss }
3536 color = { color }
3637 testID = "react-native-paper-dates-close"
Original file line number Diff line number Diff line change @@ -73,6 +73,7 @@ function Day(props: {
7373 styles . button ,
7474 { backgroundColor : inRange ? selectColor : undefined } ,
7575 ] }
76+ accessibilityRole = "button"
7677 // RN types bug
7778 hasTVPreferredFocus = { undefined }
7879 tvParallaxProperties = { undefined }
Original file line number Diff line number Diff line change @@ -260,6 +260,8 @@ function Month(props: MonthSingleProps | MonthRangeProps | MonthMultiProps) {
260260 < TouchableRipple
261261 disabled = { ! isHorizontal }
262262 onPress = { isHorizontal ? ( ) => onPressYear ( year ) : undefined }
263+ accessibilityRole = "button"
264+ accessibilityLabel = { `${ monthName } ${ year } ` }
263265 style = { [
264266 styles . yearButton ,
265267 {
Original file line number Diff line number Diff line change @@ -74,6 +74,8 @@ function YearPure({
7474 < View style = { styles . year } >
7575 < TouchableRipple
7676 onPress = { ( ) => onPressYear ( year ) }
77+ accessibilityRole = "button"
78+ accessibilityLabel = { String ( year ) }
7779 style = { styles . yearButton }
7880 // RN types bug
7981 hasTVPreferredFocus = { undefined }
Original file line number Diff line number Diff line change @@ -11,5 +11,10 @@ const en: TranslationsType = {
1111 mustBeLowerThan : 'Must be earlier then' ,
1212 mustBeBetween : 'Must be between' ,
1313 dateIsDisabled : 'Day is not allowed' ,
14+ previous : 'Previous' ,
15+ next : 'Next' ,
16+ typeInDate : 'Type in date' ,
17+ pickDateFromCalendar : 'Pick date from calendar' ,
18+ close : 'Close' ,
1419}
1520export default en
Original file line number Diff line number Diff line change @@ -11,5 +11,10 @@ const enGB: TranslationsType = {
1111 mustBeLowerThan : 'Must be earlier then' ,
1212 mustBeBetween : 'Must be between' ,
1313 dateIsDisabled : 'Day is not allowed' ,
14+ previous : 'Previous' ,
15+ next : 'Next' ,
16+ typeInDate : 'Type in date' ,
17+ pickDateFromCalendar : 'Pick date from calendar' ,
18+ close : 'Close' ,
1419}
1520export default enGB
Original file line number Diff line number Diff line change @@ -8,6 +8,11 @@ export type TranslationsType = {
88 mustBeLowerThan : string
99 mustBeBetween : string
1010 dateIsDisabled : string
11+ previous : string
12+ next : string
13+ typeInDate : string
14+ pickDateFromCalendar : string
15+ close : string
1116}
1217
1318let translationsPerLocale : Record < string , TranslationsType > = { }
You can’t perform that action at this time.
0 commit comments