mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-26 17:24:56 +00:00
[ADF-2997] The meaning of the range fields is not clear (#3338)
* [ADF-2997] restrict 'to' field not to allow dates in the future * [ADF-2997] more clear labels for start and end date fields the translation team will decide what will be the best values for the date fields
This commit is contained in:
parent
9e3a4aa49f
commit
4e70a116eb
@ -182,8 +182,8 @@
|
||||
"RANGE": {
|
||||
"FROM": "From",
|
||||
"TO": "To",
|
||||
"FROM-DATE": "Choose a date",
|
||||
"TO-DATE": "Choose a date"
|
||||
"FROM-DATE": "From",
|
||||
"TO-DATE": "To"
|
||||
},
|
||||
"VALIDATION": {
|
||||
"REQUIRED-VALUE": "Required value",
|
||||
|
@ -3,7 +3,7 @@
|
||||
<input matInput [formControl]="from" [errorStateMatcher]="matcher"
|
||||
placeholder="{{ 'SEARCH.FILTER.RANGE.FROM-DATE' | translate }}"
|
||||
[matDatepicker]="fromDatepicker"
|
||||
[max]="maxFrom"
|
||||
[max]="maxDate"
|
||||
(focusout)="onChangedHandler($event, from)">
|
||||
<mat-datepicker-toggle matSuffix [for]="fromDatepicker"></mat-datepicker-toggle>
|
||||
<mat-datepicker #fromDatepicker></mat-datepicker>
|
||||
@ -20,6 +20,7 @@
|
||||
placeholder="{{ 'SEARCH.FILTER.RANGE.TO-DATE' | translate }}"
|
||||
[matDatepicker]="toDatepicker"
|
||||
[min]="from.value"
|
||||
[max]="maxDate"
|
||||
(focusout)="onChangedHandler($event, to)">
|
||||
<mat-datepicker-toggle matSuffix [for]="toDatepicker"></mat-datepicker-toggle>
|
||||
<mat-datepicker #toDatepicker></mat-datepicker>
|
||||
@ -29,6 +30,9 @@
|
||||
<mat-error *ngIf="to.hasError('matDatepickerMin')">
|
||||
{{ 'SEARCH.FILTER.VALIDATION.NO-DAYS' | translate }}
|
||||
</mat-error>
|
||||
<mat-error *ngIf="to.hasError('matDatepickerMax')">
|
||||
{{ 'SEARCH.FILTER.VALIDATION.BEYOND-MAX-DATE' | translate }}
|
||||
</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
<div class="facet-buttons">
|
||||
|
@ -69,7 +69,7 @@ export class SearchDateRangeComponent implements SearchWidget, OnInit {
|
||||
id: string;
|
||||
settings?: SearchWidgetSettings;
|
||||
context?: SearchQueryBuilderService;
|
||||
maxFrom: any;
|
||||
maxDate: any;
|
||||
datePickerDateFormat = DEFAULT_FORMAT_DATE;
|
||||
|
||||
constructor(private dateAdapter: DateAdapter<Moment>,
|
||||
@ -99,7 +99,7 @@ export class SearchDateRangeComponent implements SearchWidget, OnInit {
|
||||
to: this.to
|
||||
});
|
||||
|
||||
this.maxFrom = moment().startOf('day');
|
||||
this.maxDate = moment().startOf('day');
|
||||
}
|
||||
|
||||
apply(model: { from: string, to: string }, isValid: boolean) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user