Skip to content

Commit e6f2bdc

Browse files
ddinchevaAleksandyrkdinev
authored
Calendar bug fix --master (#8758)
* fix(Igxcalendar): should not throw an error when viewdate is set #8060 * docs(Slider): describe properly slider continuous property #8708 * fix(MonthsView): should not throw an error when date is set #8060 Co-authored-by: Aleksandar Kamenov <[email protected]> Co-authored-by: Konstantin Dinev <[email protected]>
1 parent ba63100 commit e6f2bdc

File tree

4 files changed

+17
-3
lines changed

4 files changed

+17
-3
lines changed

projects/igniteui-angular/src/lib/calendar/calendar-base.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@ export class IgxCalendarBaseDirective implements ControlValueAccessor {
203203
* Sets the date that will be presented in the default view when the component renders.
204204
*/
205205
public set viewDate(value: Date) {
206+
if (Array.isArray(value)) { return; }
206207
if (this._viewDate) {
207208
this.selectedDatesWithoutFocus = value;
208209
}

projects/igniteui-angular/src/lib/calendar/months-view/months-view.component.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ export class IgxMonthsViewComponent implements ControlValueAccessor {
4848
* @memberof IgxMonthsViewComponent
4949
*/
5050
@Input()
51-
public set date(value) {
51+
public set date(value: Date) {
52+
if (!(value instanceof Date)) { return; }
5253
this._date = value;
5354
this.activeMonth = this.date.getMonth();
5455
}

projects/igniteui-angular/src/lib/calendar/years-view/years-view.component.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,14 @@ export class IgxYearsViewComponent implements ControlValueAccessor {
5757
* @memberof IgxYearsViewComponent
5858
*/
5959
@Input()
60-
public date = new Date();
60+
public get date() {
61+
return this._date;
62+
}
63+
64+
public set date(value: Date) {
65+
if (!(value instanceof Date)) { return; }
66+
this._date = value;
67+
}
6168

6269
/**
6370
* Gets the year format option of the years view.
@@ -181,6 +188,10 @@ export class IgxYearsViewComponent implements ControlValueAccessor {
181188
* @hidden
182189
*/
183190
private _calendarModel: Calendar;
191+
/**
192+
* @hidden
193+
*/
194+
private _date = new Date();
184195

185196
/**
186197
* @hidden

projects/igniteui-angular/src/lib/slider/slider.component.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,8 @@ export class IgxSliderComponent implements
403403
/**
404404
* An @Input property that marks the {@link IgxSliderComponent} as continuous.
405405
* By default is considered that the {@link IgxSliderComponent} is discrete.
406-
* Discrete {@link IgxSliderComponent} does not have ticks and does not show bubble labels for values.
406+
* Discrete {@link IgxSliderComponent} slider has step indicators over the track and visible thumb labels during interaction.
407+
* Continuous {@link IgxSliderComponent} does not have ticks and does not show bubble labels for values.
407408
* ```html
408409
* <igx-slider #slider [continuous]="'true'" [(ngModel)]="task.percentCompleted" [step]="5" [lowerBound]="20">
409410
* ```

0 commit comments

Comments
 (0)