@@ -14,7 +14,7 @@ import { fromEvent, merge, MonoTypeOperatorFunction, noop, Subscription } from '
14
14
import { filter , takeUntil } from 'rxjs/operators' ;
15
15
16
16
import { CalendarSelection , IgxCalendarComponent , IgxCalendarHeaderTemplateDirective , IgxCalendarHeaderTitleTemplateDirective , IgxCalendarSubheaderTemplateDirective } from '../calendar/public_api' ;
17
- import { DateRangeType } from '../core/dates' ;
17
+ import { DateRangeDescriptor , DateRangeType } from '../core/dates' ;
18
18
import { DateRangePickerResourceStringsEN , IDateRangePickerResourceStrings } from '../core/i18n/date-range-picker-resources' ;
19
19
import { clamp , IBaseCancelableBrowserEventArgs , isDate , parseDate , PlatformUtil } from '../core/utils' ;
20
20
import { IgxCalendarContainerComponent } from '../date-common/calendar-container/calendar-container.component' ;
@@ -234,6 +234,23 @@ export class IgxDateRangePickerComponent extends PickerBaseDirective
234
234
return this . _maxValue ;
235
235
}
236
236
237
+ /**
238
+ * Gets/Sets the special dates descriptors.
239
+ *
240
+ * @example
241
+ * ```typescript
242
+ * let specialDates = this.dateRangePicker.specialDates;
243
+ * this.dateRangePicker.specialDates = [ {type: DateRangeType.Weekends}, ... ];
244
+ * ```
245
+ */
246
+ @Input ( )
247
+ public get specialDates ( ) : DateRangeDescriptor [ ] {
248
+ return this . _specialDates ;
249
+ }
250
+ public set specialDates ( value : DateRangeDescriptor [ ] ) {
251
+ this . _specialDates = value ;
252
+ }
253
+
237
254
/**
238
255
* An accessor that sets the resource strings.
239
256
* By default it uses EN resources.
@@ -475,6 +492,7 @@ export class IgxDateRangePickerComponent extends PickerBaseDirective
475
492
private _positionSettings : PositionSettings ;
476
493
private _focusedInput : IgxDateRangeInputsBaseComponent ;
477
494
private _displayMonthsCount = 2 ;
495
+ private _specialDates : DateRangeDescriptor [ ] = null ;
478
496
private _overlaySubFilter :
479
497
[ MonoTypeOperatorFunction < OverlayEventArgs > , MonoTypeOperatorFunction < OverlayEventArgs | OverlayCancelableEventArgs > ] = [
480
498
filter ( x => x . id === this . _overlayId ) ,
@@ -1108,18 +1126,19 @@ export class IgxDateRangePickerComponent extends PickerBaseDirective
1108
1126
private _initializeCalendarContainer ( componentInstance : IgxCalendarContainerComponent ) {
1109
1127
this . _calendar = componentInstance . calendar ;
1110
1128
this . _calendar . hasHeader = ! this . isDropdown && ! this . hideHeader ;
1111
- this . calendar . locale = this . locale ;
1112
- this . calendar . selection = CalendarSelection . RANGE ;
1113
- this . calendar . weekStart = this . weekStart ;
1114
- this . calendar . hideOutsideDays = this . hideOutsideDays ;
1115
- this . calendar . monthsViewNumber = this . _displayMonthsCount ;
1116
- this . calendar . showWeekNumbers = this . showWeekNumbers ;
1129
+ this . _calendar . locale = this . locale ;
1130
+ this . _calendar . selection = CalendarSelection . RANGE ;
1131
+ this . _calendar . weekStart = this . weekStart ;
1132
+ this . _calendar . hideOutsideDays = this . hideOutsideDays ;
1133
+ this . _calendar . monthsViewNumber = this . _displayMonthsCount ;
1134
+ this . _calendar . showWeekNumbers = this . showWeekNumbers ;
1117
1135
this . _calendar . headerTitleTemplate = this . headerTitleTemplate ;
1118
1136
this . _calendar . headerTemplate = this . headerTemplate ;
1119
1137
this . _calendar . subheaderTemplate = this . subheaderTemplate ;
1120
1138
this . _calendar . headerOrientation = this . headerOrientation ;
1121
1139
this . _calendar . orientation = this . orientation ;
1122
- this . calendar . selected . pipe ( takeUntil ( this . _destroy$ ) ) . subscribe ( ( ev : Date [ ] ) => this . handleSelection ( ev ) ) ;
1140
+ this . _calendar . specialDates = this . specialDates ;
1141
+ this . _calendar . selected . pipe ( takeUntil ( this . _destroy$ ) ) . subscribe ( ( ev : Date [ ] ) => this . handleSelection ( ev ) ) ;
1123
1142
1124
1143
componentInstance . mode = this . mode ;
1125
1144
componentInstance . closeButtonLabel = ! this . isDropdown ? this . doneButtonText : null ;
0 commit comments