Skip to content

Commit

Permalink
feat(datepicker): review update
Browse files Browse the repository at this point in the history
  • Loading branch information
dilandoogan committed Dec 4, 2024
1 parent c1fb38f commit 3bbe9b3
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/components/calendar/bl-calendar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,17 +136,17 @@ export default class BlCalendar extends DatepickerCalendarMixin {

handleDate(date: Date) {
if (this.type !== CALENDAR_TYPES.RANGE) {
const isDateBiggerThanCalendar =
(date.getMonth() < this._calendarMonth && date.getFullYear() > this._calendarYear) ||
(date.getMonth() > this._calendarMonth && date.getFullYear() == this._calendarYear);
const isDateBeforeThanCalendar =
date.getFullYear() < this._calendarYear ||
(date.getFullYear() === this._calendarYear && date.getMonth() < this._calendarMonth);

const isDateSmallerThanCalendar =
(date.getMonth() < this._calendarMonth && date.getFullYear() == this._calendarYear) ||
(date.getMonth() > this._calendarMonth && date.getFullYear() < this._calendarYear);
const isDateAfterThanCalendar =
date.getFullYear() > this._calendarYear ||
(date.getFullYear() === this._calendarYear && date.getMonth() > this._calendarMonth);

if (isDateSmallerThanCalendar) {
if (isDateBeforeThanCalendar) {
this.setPreviousCalendarView();
} else if (isDateBiggerThanCalendar) {
} else if (isDateAfterThanCalendar) {
this.setNextCalendarView();
}
}
Expand Down

0 comments on commit 3bbe9b3

Please sign in to comment.