react-native-paper-dates
react-native-paper-dates copied to clipboard
RTL Support
Hello! Thanks for the awesome package.
do you plan on adding proper rtl support soon?
the selection indicator is flipped and and selection using mouse is reversed (if I click on 45 it chooses 15 and vice versa)

Ah we should fix this. Could you maybe do a PR for this?
Is there a spec on how it should look on RTL?
Hi is there a suggestion yet how to fix this? I also ran into the same issue
inputContainer: {
- flexDirection: 'row',
+ flexDirection: I18nManager.isRTL ? 'row-reverse' : 'row',
alignItems: 'center',
},
inside /node_modules/react-native-paper-dates/src/Time/TimePicker.tsx
#######################################
getMinuteNumbers(size: number, count: number) {
return Array(12)
.fill(true)
.map(() => {
- let x = Math.round(size / 2 + radius * Math.cos(angle))
+ let x = Math.round(I18nManager.isRTL ? size / 2 - radius * Math.cos(angle) : size / 2 + radius * Math.cos(angle))
inside /node_modules/react-native-paper-dates/src/Time/DisplayModeContext.tsx
#######################################
getHourNumbers(
return Array(arrayLength)
.fill(true)
.map(() => {
- let x = Math.round(size / 2 + radius * Math.cos(angle))
+ let x = Math.round(I18nManager.isRTL ? size / 2 - radius * Math.cos(angle) : size / 2 + radius * Math.cos(angle))
inside /node_modules/react-native-paper-dates/src/Time/AnalogClockMinutes.tsx
don't forget to import I18nManager from react-native in each file