Fix on date
This commit is contained in:
@@ -104,7 +104,7 @@ export class ListOfTunnelFlightsComponent implements OnInit {
|
|||||||
this.isLoading = true;
|
this.isLoading = true;
|
||||||
|
|
||||||
// Get data to show in a table
|
// Get data to show in a table
|
||||||
let endDate = this.dateService.addMonths(new Date(), 2);
|
let endDate = new Date();
|
||||||
endDate.setHours(0, 0, 0, 0);
|
endDate.setHours(0, 0, 0, 0);
|
||||||
let beginDate = this.computeBeginDateByPeriod(this.selectedPeriod, endDate);
|
let beginDate = this.computeBeginDateByPeriod(this.selectedPeriod, endDate);
|
||||||
|
|
||||||
|
|||||||
@@ -63,6 +63,7 @@ export class NewJumpComponent implements OnInit {
|
|||||||
private countDatasLoaded: number;
|
private countDatasLoaded: number;
|
||||||
private pendingAddRequest: boolean;
|
private pendingAddRequest: boolean;
|
||||||
private listOfDropZone: Array<DropZoneResp>;
|
private listOfDropZone: Array<DropZoneResp>;
|
||||||
|
public maxDate: Date;
|
||||||
|
|
||||||
constructor(private serviceComm: ServiceComm,
|
constructor(private serviceComm: ServiceComm,
|
||||||
private serviceJump: JumpService,
|
private serviceJump: JumpService,
|
||||||
@@ -81,6 +82,8 @@ export class NewJumpComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
this.updateTitle();
|
this.updateTitle();
|
||||||
|
|
||||||
|
this.maxDate = this.dateService.addDays(new Date(), 1);
|
||||||
|
|
||||||
this.pendingAddRequest = false;
|
this.pendingAddRequest = false;
|
||||||
this.initForm();
|
this.initForm();
|
||||||
|
|||||||
@@ -33,7 +33,7 @@
|
|||||||
|
|
||||||
<mat-form-field>
|
<mat-form-field>
|
||||||
<mat-label>{{ 'NewTunnelFlight_Date_Lbl' | translate }}</mat-label>
|
<mat-label>{{ 'NewTunnelFlight_Date_Lbl' | translate }}</mat-label>
|
||||||
<input matInput [matDatepicker]="flightDateDp" [(ngModel)]="flightDate" name="flightDate" disabled>
|
<input matInput [max]="maxDate" [matDatepicker]="flightDateDp" [(ngModel)]="flightDate" name="flightDate" disabled>
|
||||||
<mat-datepicker-toggle matSuffix [for]="flightDateDp"></mat-datepicker-toggle>
|
<mat-datepicker-toggle matSuffix [for]="flightDateDp"></mat-datepicker-toggle>
|
||||||
<mat-datepicker #flightDateDp disabled="false"></mat-datepicker>
|
<mat-datepicker #flightDateDp disabled="false"></mat-datepicker>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
|||||||
@@ -8,9 +8,9 @@ import { TunnelResp } from "../../models/tunnel";
|
|||||||
import { JumpTypeResp } from "../../models/jumpType";
|
import { JumpTypeResp } from "../../models/jumpType";
|
||||||
import { TunnelService } from '../../services/tunnel.service';
|
import { TunnelService } from '../../services/tunnel.service';
|
||||||
import { ServiceComm } from '../../services/service-comm.service';
|
import { ServiceComm } from '../../services/service-comm.service';
|
||||||
import { StatsService } from '../../services/stats.service';
|
|
||||||
import { TunnelFlightService } from "../../services/tunnel-flight.service";
|
import { TunnelFlightService } from "../../services/tunnel-flight.service";
|
||||||
import { JumpTypeService } from "../../services/jump-type.service";
|
import { JumpTypeService } from "../../services/jump-type.service";
|
||||||
|
import { DateService } from "src/services/date.service";
|
||||||
|
|
||||||
export const PICK_FORMATS = {
|
export const PICK_FORMATS = {
|
||||||
parse: { dateInput: 'yy MM dd' },
|
parse: { dateInput: 'yy MM dd' },
|
||||||
@@ -48,12 +48,14 @@ export class NewTunnelFlightComponent implements OnInit {
|
|||||||
private countDatasLoaded: number;
|
private countDatasLoaded: number;
|
||||||
private pendingAddRequest: boolean;
|
private pendingAddRequest: boolean;
|
||||||
public listOfJumpType: Array<JumpTypeResp>;
|
public listOfJumpType: Array<JumpTypeResp>;
|
||||||
|
public maxDate: Date;
|
||||||
|
|
||||||
constructor(private serviceComm: ServiceComm,
|
constructor(private serviceComm: ServiceComm,
|
||||||
private serviceTunnel: TunnelService,
|
private serviceTunnel: TunnelService,
|
||||||
private serviceTunnelFlight: TunnelFlightService,
|
private serviceTunnelFlight: TunnelFlightService,
|
||||||
private serviceJumpType: JumpTypeService,
|
private serviceJumpType: JumpTypeService,
|
||||||
private translateService: TranslateService) { }
|
private translateService: TranslateService,
|
||||||
|
private dateService: DateService) { }
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.serviceComm.forceTranslateTitle.subscribe((data) => {
|
this.serviceComm.forceTranslateTitle.subscribe((data) => {
|
||||||
@@ -63,6 +65,7 @@ export class NewTunnelFlightComponent implements OnInit {
|
|||||||
});
|
});
|
||||||
this.updateTitle();
|
this.updateTitle();
|
||||||
|
|
||||||
|
this.maxDate = this.dateService.addDays(new Date(), 1);
|
||||||
this.countDatasLoaded = 0;
|
this.countDatasLoaded = 0;
|
||||||
this.pendingAddRequest = false;
|
this.pendingAddRequest = false;
|
||||||
this.initForm();
|
this.initForm();
|
||||||
|
|||||||
Reference in New Issue
Block a user