Fix autour des dates.
This commit is contained in:
@@ -5,6 +5,7 @@ import { ServiceApiPost } from '../../services/serviceApiPost';
|
||||
import { JumpTypeResp } from '../../models/jumpType';
|
||||
import { AircraftResp } from '../../models/aircraft';
|
||||
import { DropZoneResp } from '../../models/dropzone';
|
||||
import { DateService } from '../../services/dateService';
|
||||
|
||||
|
||||
@Component({
|
||||
@@ -29,25 +30,22 @@ export class NewJumpComponent implements OnInit {
|
||||
|
||||
constructor(private serviceComm: ServiceComm,
|
||||
private serviceApiGet: ServiceApiGet,
|
||||
private serviceApiPost: ServiceApiPost) {
|
||||
private serviceApiPost: ServiceApiPost,
|
||||
private dateService: DateService) {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.serviceComm.updatedComponentTitle('Add a new jump');
|
||||
|
||||
this.beginDate = new Date();
|
||||
|
||||
const t = this.beginDate.getTime();
|
||||
this.endDate = new Date();
|
||||
this.endDate.setTime(t - (1000 * 60 * 60 * 24));
|
||||
|
||||
this.beginDate = this.dateService.AddDays(new Date(), -1);
|
||||
|
||||
this.defaultExitAltitude = 4000;
|
||||
this.defaultDeployAltitude = 1000;
|
||||
this.countOfJumps = 0;
|
||||
this.countOfJumps = 1;
|
||||
|
||||
this.getListOfJumpTypes();
|
||||
this.getListOfAircrafts();
|
||||
this.getListOfDropZones();
|
||||
}
|
||||
|
||||
onFormSubmit() {
|
||||
@@ -69,6 +67,8 @@ export class NewJumpComponent implements OnInit {
|
||||
this.serviceApiGet.getListOfJumpTypes()
|
||||
.subscribe(data => {
|
||||
this.listOfJumpType = data;
|
||||
this.getListOfAircrafts();
|
||||
this.getListOfDropZones();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user