diff --git a/src/app/public/modules/datepicker/datepicker-calendar.component.ts b/src/app/public/modules/datepicker/datepicker-calendar.component.ts index 72908971..66c88ee2 100644 --- a/src/app/public/modules/datepicker/datepicker-calendar.component.ts +++ b/src/app/public/modules/datepicker/datepicker-calendar.component.ts @@ -29,14 +29,20 @@ export class SkyDatepickerCalendarComponent { @Input() public maxDate: Date; - /** starting day of the week from 0-6 (0=Sunday, ..., 6=Saturday) */ - @Input() - public startingDay: number; - /** currently selected date */ @Input() public selectedDate: Date; + /** starting day of the week from 0-6 (0=Sunday, ..., 6=Saturday) */ + @Input() + public set startingDay(start: number) { + this._startingDay = start; + } + + public get startingDay() { + return this._startingDay || 0; + } + @Output() public selectedDateChange: EventEmitter = new EventEmitter(undefined); @@ -51,6 +57,8 @@ export class SkyDatepickerCalendarComponent { private formatter = new SkyDateFormatter(); + private _startingDay: number; + public constructor(config: SkyDatepickerConfigService) { this.config = config; this.configureOptions(); diff --git a/src/app/public/modules/datepicker/fixtures/datepicker-calendar.component.fixture.ts b/src/app/public/modules/datepicker/fixtures/datepicker-calendar.component.fixture.ts index 4eebc59c..70e2d95a 100644 --- a/src/app/public/modules/datepicker/fixtures/datepicker-calendar.component.fixture.ts +++ b/src/app/public/modules/datepicker/fixtures/datepicker-calendar.component.fixture.ts @@ -19,7 +19,7 @@ export class DatepickerCalendarTestComponent { public selectedDate: any; - public startingDay: number = 0; + public startingDay: number; @ViewChild(SkyDatepickerCalendarComponent) public datepicker: SkyDatepickerCalendarComponent;