core/date-time-picker/date-time-picker.component.ts
ControlValueAccessor
Validator
OnDestroy
providers |
{
provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => DateTimePickerComponent), multi: true
}
{
provide: NG_VALIDATORS, useExisting: forwardRef(() => DateTimePickerComponent), multi: true
}
|
selector | c8y-date-time-picker |
templateUrl | ./date-time-picker.component.html |
Properties |
Methods |
Inputs |
Accessors |
constructor()
|
maxDate |
Type : string
|
minDate |
Type : string
|
placeholder |
Type : string
|
nextDay |
nextDay()
|
Returns :
void
|
ngOnDestroy |
ngOnDestroy()
|
Returns :
void
|
previousDay |
previousDay()
|
Returns :
void
|
registerOnChange | ||||||
registerOnChange(fn: any)
|
||||||
Parameters :
Returns :
void
|
registerOnTouched | ||||||
registerOnTouched(onTouched: any)
|
||||||
Parameters :
Returns :
void
|
setDisabledState | ||||||
setDisabledState(disabled: boolean)
|
||||||
Parameters :
Returns :
void
|
validate | ||||||
validate(control: AbstractControl)
|
||||||
Parameters :
Returns :
ValidationErrors | null
|
writeValue | ||||||
writeValue(value: string)
|
||||||
Control Value Accessor - If form value changes by external factor, update date property and internal form with new value.
Parameters :
Returns :
void
|
date |
Type : Date
|
defaultPlaceholder |
Default value : gettext('Select a dateā¦')
|
form |
Type : FormGroup
|
maxDate |
Type : Date
|
minDate |
Type : Date
|
onChange |
Type : function
|
onTouched |
Type : function
|
_minDate | ||||||
set_minDate(value: string)
|
||||||
Parameters :
Returns :
void
|
_maxDate | ||||||
set_maxDate(value: string)
|
||||||
Parameters :
Returns :
void
|
<div class="datetime-picker">
<div class="form-group datepicker">
<input
class="form-control"
[placeholder]="placeholder || defaultPlaceholder | translate"
bsDatepicker
[bsConfig]="{ customTodayClass: 'today', dateInputFormat: 'YYYY-MM-DD' }"
[formControl]="form.get('date')"
(blur)="onTouched()"
[minDate]="minDate"
[maxDate]="maxDate"
/>
</div>
<c8y-time-picker
[formControl]="form.get('time')"
(dayBackward)="previousDay()"
(dayForward)="nextDay()"
></c8y-time-picker>
</div>