Skip to content

Commit

Permalink
feat(datepicker): fix selected date showing for all dates (#987)
Browse files Browse the repository at this point in the history
  • Loading branch information
dilandoogan authored Jan 9, 2025
1 parent c0bd9eb commit d8ed355
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/components/calendar/bl-calendar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,12 @@ export default class BlCalendar extends DatepickerCalendarMixin {
}

checkIfSelectedDate(calendarDate: Date) {
return this._selectedDates?.some(date => date?.getTime() === calendarDate.getTime());
return this._selectedDates?.some(
date =>
date.getFullYear() === calendarDate.getFullYear() &&
date.getMonth() === calendarDate.getMonth() &&
date.getDate() === calendarDate.getDate()
);
}

checkIfDateIsToday(calendarDate: Date) {
Expand Down

0 comments on commit d8ed355

Please sign in to comment.