Skip to content

Commit f198c27

Browse files
committed
fix: UDateRangePicker: month of week's range from day now works as expected
1 parent fd8ae85 commit f198c27

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

src/ui.form-date-picker-range/utilDateRange.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -96,16 +96,9 @@ export function getWeekDateList(date: Date, monthShortLocales: string[] = []) {
9696
const firstDayOfWeek = startOfWeekDate.getDate();
9797
const lastDayOfWeek = endOfWeekDate.getDate();
9898

99-
const isDayInPreviousMonth = week === 0 && firstDayOfWeek > 1;
100-
const isLastWeek = week + day === weeksInMonth;
101-
102-
let monthFirstDayOfWeek = 0;
99+
const monthFirstDayOfWeek = startOfWeekDate.getMonth();
103100
const monthLastDayOfWeek = endOfWeekDate.getMonth();
104101

105-
if (isDayInPreviousMonth || isLastWeek) {
106-
monthFirstDayOfWeek = startOfWeekDate.getMonth();
107-
}
108-
109102
const title = `${firstDayOfWeek} ${
110103
monthShortLocales[monthFirstDayOfWeek] || ""
111104
}${lastDayOfWeek} ${monthShortLocales[monthLastDayOfWeek]}`;

0 commit comments

Comments
 (0)