Skip to content

Commit b96a043

Browse files
committed
Calendar - RTL - fix swipe direction
1 parent af705a7 commit b96a043

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/calendar/index.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {View, ViewStyle, StyleProp} from 'react-native';
66
// @ts-expect-error
77
import GestureRecognizer, {swipeDirections} from 'react-native-swipe-gestures';
88

9+
import constants from '../commons/constants';
910
import {page, isGTE, isLTE, sameMonth} from '../dateutils';
1011
import {xdateToData, parseDate, toMarkingFormat} from '../interface';
1112
import {getState} from '../day-state-manager';
@@ -156,10 +157,10 @@ const Calendar = (props: CalendarProps) => {
156157
case SWIPE_DOWN:
157158
break;
158159
case SWIPE_LEFT:
159-
onSwipeLeft();
160+
constants.isRTL ? onSwipeRight() : onSwipeLeft();
160161
break;
161162
case SWIPE_RIGHT:
162-
onSwipeRight();
163+
constants.isRTL ? onSwipeLeft() : onSwipeRight();
163164
break;
164165
}
165166
}, [onSwipeLeft, onSwipeRight]);

0 commit comments

Comments
 (0)