Skip to content

Commit ff8e04e

Browse files
committed
fix: fix type error and bug
1 parent a1d2346 commit ff8e04e

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

components/events/Days.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ const Days: FC<ComponentProps> = ({
110110
});
111111
const selectedDates = getSelectedDates({
112112
startDate,
113-
currentTableIndex: dayIndex,
113+
startXIndex: dayIndex,
114114
pageIndex: currentPageIndex,
115115
});
116116
const method = {

components/events/Timetable.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ const Timetable: FC<ComponentProps> = ({
144144
currentSelectedArea,
145145
timetableAreaRef.current,
146146
startDate,
147-
columnIndexOfSelectedAreaRef.current
147+
currentPageIndex
148148
);
149149

150150
if (!selectedDates.length) {
@@ -171,6 +171,7 @@ const Timetable: FC<ComponentProps> = ({
171171
initializeMouseAndTouchMove,
172172
initializeMouseAndTouchStart,
173173
id,
174+
currentPageIndex,
174175
]);
175176

176177
useMouseAndTouchEnd(updateAttendeesAndResetSelectedArea);

lib/days.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ export function getSelectedDatesWithSelectedArea(
9393
) {
9494
const { startXIndex, endXIndex } = getXIndexesFromTable(selectedArea, table);
9595
const { startYIndex, endYIndex } = getYIndexesFromTable(selectedArea, table);
96-
96+
9797
return getSelectedDates({
9898
pageIndex,
9999
startDate,
@@ -145,17 +145,17 @@ export function getSelectedDates({
145145
pageIndex,
146146
startDate,
147147
startXIndex,
148-
endXIndex,
149-
startYIndex,
150-
endYIndex,
148+
endXIndex = startXIndex,
149+
startYIndex = 0,
150+
endYIndex = 15,
151151
startTime = 8,
152152
}: {
153153
pageIndex: number;
154154
startDate: Date;
155155
startXIndex: number;
156-
endXIndex: number;
157-
startYIndex: number;
158-
endYIndex: number;
156+
endXIndex?: number;
157+
startYIndex?: number;
158+
endYIndex?: number;
159159
startTime?: number;
160160
}) {
161161
if (endYIndex - startYIndex + 1 < 0) return [];
@@ -170,6 +170,7 @@ export function getSelectedDates({
170170
)
171171
);
172172
}
173+
console.log(selectedDates);
173174
return selectedDates;
174175
}
175176

0 commit comments

Comments
 (0)