File tree 1 file changed +10
-4
lines changed
projects/igniteui-angular/src/lib/calendar/days-view
1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -207,17 +207,23 @@ export class IgxDaysViewComponent extends IgxCalendarBase implements DoCheck {
207
207
* @hidden
208
208
*/
209
209
public isSelected ( date : ICalendarDate ) : boolean {
210
- const selectedDates = ( this . value as Date [ ] ) ;
210
+ let selectedDates : Date | Date [ ] ;
211
211
if ( ! date . isCurrentMonth ) {
212
212
return false ;
213
213
}
214
214
215
- if ( ! this . value || selectedDates . length === 0 ) {
215
+ if ( ! this . value || ( Array . isArray ( this . value ) && this . value . length === 0 ) ) {
216
216
return false ;
217
217
}
218
218
219
- if ( selectedDates . length === 1 ) {
220
- return this . value [ 0 ] . getTime ( ) === date . date . getTime ( ) ;
219
+ if ( this . selection === CalendarSelection . SINGLE ) {
220
+ selectedDates = ( this . value as Date ) ;
221
+ return this . getDateOnly ( selectedDates ) . getTime ( ) === date . date . getTime ( ) ;
222
+ }
223
+
224
+ selectedDates = ( this . value as Date [ ] ) ;
225
+ if ( this . selection === CalendarSelection . RANGE && selectedDates . length === 1 ) {
226
+ return this . getDateOnly ( selectedDates [ 0 ] ) . getTime ( ) === date . date . getTime ( ) ;
221
227
}
222
228
223
229
if ( this . selection === CalendarSelection . MULTI ) {
You can’t perform that action at this time.
0 commit comments