mirror of
https://github.com/ckaczor/HomeMonitor.git
synced 2026-01-14 01:25:38 -05:00
Set max date on picker
This commit is contained in:
@@ -13,7 +13,7 @@
|
|||||||
<mat-icon>arrow_back</mat-icon>
|
<mat-icon>arrow_back</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
<mat-form-field *ngIf="selectedTimeSpan === timeSpans.Day">
|
<mat-form-field *ngIf="selectedTimeSpan === timeSpans.Day">
|
||||||
<input matInput [matDatepicker]="picker" [(ngModel)]="selectedDate" disabled>
|
<input matInput [matDatepicker]="picker" [(ngModel)]="selectedDate" disabled [max]="maxDate">
|
||||||
<mat-datepicker-toggle matSuffix [for]="picker">
|
<mat-datepicker-toggle matSuffix [for]="picker">
|
||||||
<mat-icon matDatepickerToggleIcon>keyboard_arrow_down</mat-icon>
|
<mat-icon matDatepickerToggleIcon>keyboard_arrow_down</mat-icon>
|
||||||
</mat-datepicker-toggle>
|
</mat-datepicker-toggle>
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ export class WeatherChartsComponent implements OnInit {
|
|||||||
|
|
||||||
public timeSpanItems: { [value: number]: string } = {};
|
public timeSpanItems: { [value: number]: string } = {};
|
||||||
public timeSpans: typeof TimeSpan = TimeSpan;
|
public timeSpans: typeof TimeSpan = TimeSpan;
|
||||||
|
public maxDate: moment.Moment = moment().endOf('day');
|
||||||
|
|
||||||
private selectedTimeSpanValue: TimeSpan = TimeSpan.Last24Hours;
|
private selectedTimeSpanValue: TimeSpan = TimeSpan.Last24Hours;
|
||||||
private selectedDateValue: moment.Moment = moment().startOf('day');
|
private selectedDateValue: moment.Moment = moment().startOf('day');
|
||||||
|
|||||||
Reference in New Issue
Block a user