Skip to content

Commit

Permalink
feat(module:timepicker): support dynamic binding [nzDisabledHours] (N…
Browse files Browse the repository at this point in the history
  • Loading branch information
hsuanxyz authored and vthinkxie committed Nov 16, 2017
1 parent 9b9c063 commit 878fdd2
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/components/time-picker/nz-timepicker-inner.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ export class NzTimePickerInnerComponent implements OnInit, ControlValueAccessor
_showSecond = this._format.indexOf('ss') > -1;
_width = ( +this._showHour + +this._showMinute + +this._showSecond) * 56 + 1 + 'px';
_hideDisabledOptions = false;
_nzDisabledHours: Function;
// ngModel Access
onChange: any = Function.prototype;
onTouched: any = Function.prototype;
Expand All @@ -157,7 +158,17 @@ export class NzTimePickerInnerComponent implements OnInit, ControlValueAccessor

@Input() nzPlaceHolder = this._locale.translate('DateTime.chooseTimePlease');
@Input() nzSize: 'small' | 'large' | 'default' = 'default';
@Input() nzDisabledHours;

@Input()
set nzDisabledHours(fun: Function) {
this._nzDisabledHours = fun;
this._buildHours();
}

get nzDisabledHours(): Function {
return this._nzDisabledHours;
}

@Input() nzDisabledMinutes;
@Input() nzDisabledSeconds;
@Input() nzDisabled = false;
Expand Down

0 comments on commit 878fdd2

Please sign in to comment.