Skip to content

Commit ef5cbd0

Browse files
committed
Changed file version and name
1 parent 9c56a98 commit ef5cbd0

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

src/components/Calendar/Days.tsx

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -164,12 +164,12 @@ const Days: React.FC<Props> = ({
164164
next: nextMonth(calendarData.date)
165165
};
166166
const newDate = object[type as keyof typeof object];
167-
const newHover = `${newDate.year()}-${newDate.month() + 1}-${
167+
const formattedDate = `${newDate.year()}-${newDate.month() + 1}-${
168168
day >= 10 ? day : "0" + day
169169
}`;
170-
return dayjs(newHover).isSame(dayjs(minDate))
170+
return dayjs(formattedDate).isSame(dayjs(minDate))
171171
? false
172-
: dayjs(newHover).isBefore(dayjs(minDate));
172+
: dayjs(formattedDate).isBefore(dayjs(minDate));
173173
},
174174
[calendarData.date, minDate]
175175
);
@@ -185,12 +185,12 @@ const Days: React.FC<Props> = ({
185185
next: nextMonth(calendarData.date)
186186
};
187187
const newDate = object[type as keyof typeof object];
188-
const newHover = `${newDate.year()}-${newDate.month() + 1}-${
188+
const formattedDate = `${newDate.year()}-${newDate.month() + 1}-${
189189
day >= 10 ? day : "0" + day
190190
}`;
191-
return dayjs(newHover).isSame(maxDate)
191+
return dayjs(formattedDate).isSame(maxDate)
192192
? false
193-
: dayjs(newHover).isAfter(dayjs(maxDate));
193+
: dayjs(formattedDate).isAfter(dayjs(maxDate));
194194
},
195195
[calendarData.date, maxDate]
196196
);
@@ -206,7 +206,7 @@ const Days: React.FC<Props> = ({
206206
next: nextMonth(calendarData.date)
207207
};
208208
const newDate = object[type as keyof typeof object];
209-
const newHover = `${newDate.year()}-${newDate.month() + 1}-${
209+
const formattedDate = `${newDate.year()}-${newDate.month() + 1}-${
210210
day >= 10 ? day : "0" + day
211211
}`;
212212

@@ -217,14 +217,14 @@ const Days: React.FC<Props> = ({
217217
let matchingCount = 0;
218218
disabledDates?.forEach(dateRange => {
219219
if (
220-
dayjs(newHover).isAfter(dateRange.startDate) &&
221-
dayjs(newHover).isBefore(dateRange.endDate)
220+
dayjs(formattedDate).isAfter(dateRange.startDate) &&
221+
dayjs(formattedDate).isBefore(dateRange.endDate)
222222
) {
223223
matchingCount++;
224224
}
225225
if (
226-
dayjs(newHover).isSame(dateRange.startDate) ||
227-
dayjs(newHover).isSame(dateRange.endDate)
226+
dayjs(formattedDate).isSame(dateRange.startDate) ||
227+
dayjs(formattedDate).isSame(dateRange.endDate)
228228
) {
229229
matchingCount++;
230230
}

0 commit comments

Comments
 (0)