Skip to content

Commit

Permalink
fix(ui-calendar): remove unnecessary warnings about date parsing
Browse files Browse the repository at this point in the history
Backport of #1681 to InstUI v9
  • Loading branch information
matyasf committed Sep 19, 2024
1 parent 4c55bc9 commit d8f0ac7
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 d8f0ac7

Please sign in to comment.