File
Index
Properties
|
|
Methods
|
|
Inputs
|
|
Outputs
|
|
formGroup
|
Type : ReturnType<>
|
Outputs
onDateFromChange
|
Type : EventEmitter<string>
|
onDateToChange
|
Type : EventEmitter<string>
|
Methods
emitDateFromChange
|
emitDateFromChange(updatedDate: string)
|
Parameters :
Name |
Type |
Optional |
updatedDate |
string
|
No
|
|
emitDateToChange
|
emitDateToChange(updatedDate: string)
|
Parameters :
Name |
Type |
Optional |
updatedDate |
string
|
No
|
|
Readonly
DATE_FROM
|
Type : string
|
Default value : 'dateFrom'
|
Readonly
DATE_TO
|
Type : string
|
Default value : 'dateTo'
|
Readonly
FROM_DATE
|
Default value : gettext('From`date`')
|
Readonly
HAS_ERROR
|
Default value : HAS_ERROR
|
Readonly
INVALID_DATE_TIME
|
Type : string
|
Default value : 'invalidDateTime'
|
Readonly
THIS_DATE_IS_AFTER_THE_LAST_ALLOWED_DATE
|
Default value : gettext(
'This date is after the latest allowed date.'
)
|
Readonly
THIS_DATE_IS_BEFORE_THE_EARLIEST_ALLOWED_DATE
|
Default value : gettext(
'This date is before the earliest allowed date.'
)
|
Readonly
THIS_DATE_IS_INVALID
|
Default value : gettext('This date is invalid.')
|
Readonly
TO_DATE
|
Default value : gettext('To`date`')
|
<fieldset class="c8y-fieldset">
<legend>{{ 'Time range' | translate }}</legend>
<c8y-form-group
class="m-b-8"
[ngClass]="formGroup.controls.dateFrom.errors ? HAS_ERROR : ''"
>
<label
[title]="FROM_DATE | translate"
[for]="DATE_FROM"
>
{{ FROM_DATE | translate }}
</label>
<div>
<c8y-date-time-picker
id="DATE_FROM"
[maxDate]="formGroup.value.dateTo"
[placeholder]="FROM_DATE | translate"
[formControl]="formGroup.controls.dateFrom"
[ngClass]="formGroup.controls.dateFrom.errors ? HAS_ERROR : ''"
(ngModelChange)="emitDateFromChange($event)"
></c8y-date-time-picker>
<c8y-messages [show]="formGroup.controls.dateFrom.errors">
<c8y-message
name="dateAfterRangeMax"
[text]="THIS_DATE_IS_AFTER_THE_LAST_ALLOWED_DATE | translate"
></c8y-message>
<c8y-message
name="INVALID_DATE_TIME"
[text]="THIS_DATE_IS_INVALID | translate"
></c8y-message>
</c8y-messages>
</div>
</c8y-form-group>
<c8y-form-group
class="m-b-8"
[ngClass]="formGroup.controls.dateTo.errors ? HAS_ERROR : ''"
>
<label
[title]="TO_DATE | translate"
[for]="DATE_TO"
>
{{ TO_DATE | translate }}
</label>
<div>
<c8y-date-time-picker
id="DATE_TO"
[minDate]="formGroup.value.dateFrom"
[placeholder]="TO_DATE | translate"
[formControl]="formGroup.controls.dateTo"
[ngClass]="formGroup.controls.dateTo.errors ? HAS_ERROR : ''"
(ngModelChange)="emitDateToChange($event)"
></c8y-date-time-picker>
<c8y-messages [show]="formGroup.controls.dateTo.errors">
<c8y-message
name="dateBeforeRangeMin"
[text]="THIS_DATE_IS_BEFORE_THE_EARLIEST_ALLOWED_DATE | translate"
></c8y-message>
<c8y-message
name="INVALID_DATE_TIME"
[text]="THIS_DATE_IS_INVALID | translate"
></c8y-message>
</c8y-messages>
</div>
</c8y-form-group>
</fieldset>