Skip to content

Commit

Permalink
fix(ui-calendar): fix code to remove unnecessary warnings
Browse files Browse the repository at this point in the history
backport of #1681 to v9
  • Loading branch information
matyasf committed Sep 19, 2024
1 parent 4c55bc9 commit 266c7af
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/ui-calendar/src/Calendar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,14 @@ class Calendar extends Component<CalendarProps, CalendarState> {
<Calendar.Day
key={dateStr}
date={dateStr}
isSelected={selectedDate ? date.isSame(selectedDate, 'day') : false}
isSelected={
selectedDate
? date.isSame(
DateTime.parse(selectedDate, this.locale(), this.timezone()),
'day'
)
: false
}
isToday={date.isSame(today, 'day')}
isOutsideMonth={!date.isSame(visibleMonth, 'month')}
label={date.format('D MMMM YYYY')} // used by screen readers
Expand Down

0 comments on commit 266c7af

Please sign in to comment.