Skip to content

Commit a1c8fd1

Browse files
committed
Calendar getItemIndex - revert fix
1 parent 9aa2f62 commit a1c8fd1

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/incubator/Calendar/index.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {FlashListPackage} from 'optionalDeps';
44
import {Constants} from '../../commons/new';
55
import {generateMonthItems} from './helpers/CalendarProcessor';
66
import {addHeaders} from './helpers/DataProcessor';
7-
import {isSameMonth, getTimestamp, addYears, getDateObject} from './helpers/DateUtils';
7+
import {isSameMonth, getTimestamp, addYears} from './helpers/DateUtils';
88
import {CalendarContextProps, CalendarProps, FirstDayOfWeek, UpdateSource, DateObjectWithOptionalDay} from './types';
99
import CalendarContext from './CalendarContext';
1010
import CalendarItem from './CalendarItem';
@@ -36,9 +36,8 @@ function Calendar(props: PropsWithChildren<CalendarProps>) {
3636

3737
const getItemIndex = useCallback((date: number) => {
3838
'worklet';
39-
const dateObject = getDateObject(date);
4039
for (let i = 0; i < items.length; i++) {
41-
if (items[i].month === dateObject.month) {
40+
if (isSameMonth(items[i], date)) {
4241
return i;
4342
}
4443
}

0 commit comments

Comments
 (0)