This commit is contained in:
Sébastien André
2020-08-25 16:25:24 +02:00
parent 4ee2dc98ae
commit 25cfc62005
2 changed files with 36 additions and 23 deletions

View File

@@ -12,8 +12,6 @@ import { JumpTypeService } from "../../services/jump-type.service";
import { GearService } from "../../services/gear.service";
import { isNumber } from "util";
import { FormControl } from "@angular/forms";
@Component({
selector: "app-new-jump",
templateUrl: "./new-jump.component.html",
@@ -54,7 +52,7 @@ export class NewJumpComponent implements OnInit {
this.beginDate = this.dateService.AddDays(new Date(), -1);
this.exitAltitude = 4000;
this.deployAltitude = 1500;
this.deployAltitude = 1000;
this.countOfJumps = 1;
this.getListOfJumpTypes();
@@ -73,6 +71,8 @@ export class NewJumpComponent implements OnInit {
this.deployAltitude,
this.countOfJumps
);
this.initForm();
}
public isValidatedForm(): boolean {
@@ -128,6 +128,20 @@ export class NewJumpComponent implements OnInit {
});
}
private initForm() {
this.endDate = new Date();
this.beginDate = this.dateService.AddDays(new Date(), -1);
this.exitAltitude = 4000;
this.deployAltitude = 1000;
this.countOfJumps = 1;
this.selectedDz = undefined;
this.selectedGear = undefined;
this.selectedAircraft = undefined;
this.selectedJumpType = undefined;
}
public displayFn(data?: JumpTypeResp): string | undefined {
return data ? data.name : undefined;
}