core/time-picker/time-picker.component.ts
ControlValueAccessor
OnDestroy
providers |
{
provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => TimePickerComponent), multi: true
}
|
selector | c8y-time-picker |
templateUrl | ./time-picker.component.html |
Properties |
Methods |
Inputs |
Outputs |
constructor(cdRef: ChangeDetectorRef)
|
||||||
Parameters :
|
maxDate |
Type : string
|
minDate |
Type : string
|
placeholder |
Type : string
|
dayBackward |
Type : EventEmitter
|
dayForward |
Type : EventEmitter
|
emitValue |
emitValue()
|
Returns :
void
|
handleHourScroll | ||||
handleHourScroll(ev)
|
||||
Parameters :
Returns :
void
|
handleMinuteScroll | ||||
handleMinuteScroll(ev)
|
||||
Parameters :
Returns :
void
|
initializeHours |
initializeHours()
|
Returns :
void
|
initializeMinutes |
initializeMinutes()
|
Returns :
void
|
markAsTouched |
markAsTouched()
|
Returns :
void
|
ngOnDestroy |
ngOnDestroy()
|
Returns :
void
|
parseValue | ||||||||
parseValue(target, lastValid, limit)
|
||||||||
Parameters :
Returns :
void
|
registerOnChange | ||||||
registerOnChange(fn: any)
|
||||||
Parameters :
Returns :
void
|
registerOnTouched | ||||||
registerOnTouched(onTouched: any)
|
||||||
Parameters :
Returns :
void
|
setDisabledState | ||||||
setDisabledState(disabled: boolean)
|
||||||
Parameters :
Returns :
void
|
writeValue | ||||||
writeValue(value: literal type)
|
||||||
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
|
Default value : new Date()
|
disabled |
Default value : false
|
hours |
Type : string
|
lastValidHours |
Type : string
|
Default value : '00'
|
lastValidMinutes |
Type : string
|
Default value : '00'
|
minutes |
Type : string
|
onChange |
Type : function
|
onTouched |
Type : function
|
<table>
<tbody>
<tr>
<td class="form-group">
<input
type="text"
class="form-control text-center bs-timepicker-field"
[disabled]="disabled"
[placeholder]="'HH`HOURS`' | translate"
[(ngModel)]="hours"
(input)="parseValue('hours', 'lastValidHours', 23); initializeMinutes()"
(change)="emitValue()"
(wheel)="handleHourScroll($event)"
(focus)="markAsTouched()"
/>
</td>
<td> : </td>
<td class="form-group">
<input
type="text"
class="form-control text-center bs-timepicker-field"
[disabled]="disabled"
[placeholder]="'MM`MINUTES`' | translate"
[(ngModel)]="minutes"
(input)="parseValue('minutes', 'lastValidMinutes', 59); initializeHours()"
(change)="emitValue()"
(wheel)="handleMinuteScroll($event)"
(focus)="markAsTouched()"
/>
</td>
</tr>
</tbody>
</table>