Skip to content

Commit c1fb38f

Browse files
committed
feat(datepicker): bug fix for date selection
1 parent 20b534d commit c1fb38f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/components/calendar/bl-calendar.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,10 +138,10 @@ export default class BlCalendar extends DatepickerCalendarMixin {
138138
if (this.type !== CALENDAR_TYPES.RANGE) {
139139
const isDateBiggerThanCalendar =
140140
(date.getMonth() < this._calendarMonth && date.getFullYear() > this._calendarYear) ||
141-
(date.getMonth() >= this._calendarMonth && date.getFullYear() >= this._calendarYear);
141+
(date.getMonth() > this._calendarMonth && date.getFullYear() == this._calendarYear);
142142

143143
const isDateSmallerThanCalendar =
144-
(date.getMonth() <= this._calendarMonth && date.getFullYear() <= this._calendarYear) ||
144+
(date.getMonth() < this._calendarMonth && date.getFullYear() == this._calendarYear) ||
145145
(date.getMonth() > this._calendarMonth && date.getFullYear() < this._calendarYear);
146146

147147
if (isDateSmallerThanCalendar) {

0 commit comments

Comments
 (0)