From 6ab76db4f40df49296981d8f4d5b9bd872db718c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20ANDRE?= Date: Tue, 5 Dec 2023 09:36:42 +0100 Subject: [PATCH] Fix on date --- .../list-of-tunnel-flights.component.ts | 2 +- .../skydivelogs-app/src/app/new-jump/new-jump.component.ts | 3 +++ .../app/new-tunnel-flight/new-tunnel-flight.component.html | 2 +- .../app/new-tunnel-flight/new-tunnel-flight.component.ts | 7 +++++-- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/Front/skydivelogs-app/src/app/list-of-tunnel-flights/list-of-tunnel-flights.component.ts b/Front/skydivelogs-app/src/app/list-of-tunnel-flights/list-of-tunnel-flights.component.ts index ccffc69..0375b77 100644 --- a/Front/skydivelogs-app/src/app/list-of-tunnel-flights/list-of-tunnel-flights.component.ts +++ b/Front/skydivelogs-app/src/app/list-of-tunnel-flights/list-of-tunnel-flights.component.ts @@ -104,7 +104,7 @@ export class ListOfTunnelFlightsComponent implements OnInit { this.isLoading = true; // 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); let beginDate = this.computeBeginDateByPeriod(this.selectedPeriod, endDate); diff --git a/Front/skydivelogs-app/src/app/new-jump/new-jump.component.ts b/Front/skydivelogs-app/src/app/new-jump/new-jump.component.ts index 13879ab..c629f92 100644 --- a/Front/skydivelogs-app/src/app/new-jump/new-jump.component.ts +++ b/Front/skydivelogs-app/src/app/new-jump/new-jump.component.ts @@ -63,6 +63,7 @@ export class NewJumpComponent implements OnInit { private countDatasLoaded: number; private pendingAddRequest: boolean; private listOfDropZone: Array; + public maxDate: Date; constructor(private serviceComm: ServiceComm, private serviceJump: JumpService, @@ -81,6 +82,8 @@ export class NewJumpComponent implements OnInit { } }); this.updateTitle(); + + this.maxDate = this.dateService.addDays(new Date(), 1); this.pendingAddRequest = false; this.initForm(); diff --git a/Front/skydivelogs-app/src/app/new-tunnel-flight/new-tunnel-flight.component.html b/Front/skydivelogs-app/src/app/new-tunnel-flight/new-tunnel-flight.component.html index 646b7b0..f17874c 100644 --- a/Front/skydivelogs-app/src/app/new-tunnel-flight/new-tunnel-flight.component.html +++ b/Front/skydivelogs-app/src/app/new-tunnel-flight/new-tunnel-flight.component.html @@ -33,7 +33,7 @@ {{ 'NewTunnelFlight_Date_Lbl' | translate }} - + diff --git a/Front/skydivelogs-app/src/app/new-tunnel-flight/new-tunnel-flight.component.ts b/Front/skydivelogs-app/src/app/new-tunnel-flight/new-tunnel-flight.component.ts index 231a3a9..a49996e 100644 --- a/Front/skydivelogs-app/src/app/new-tunnel-flight/new-tunnel-flight.component.ts +++ b/Front/skydivelogs-app/src/app/new-tunnel-flight/new-tunnel-flight.component.ts @@ -8,9 +8,9 @@ import { TunnelResp } from "../../models/tunnel"; import { JumpTypeResp } from "../../models/jumpType"; import { TunnelService } from '../../services/tunnel.service'; import { ServiceComm } from '../../services/service-comm.service'; -import { StatsService } from '../../services/stats.service'; import { TunnelFlightService } from "../../services/tunnel-flight.service"; import { JumpTypeService } from "../../services/jump-type.service"; +import { DateService } from "src/services/date.service"; export const PICK_FORMATS = { parse: { dateInput: 'yy MM dd' }, @@ -48,12 +48,14 @@ export class NewTunnelFlightComponent implements OnInit { private countDatasLoaded: number; private pendingAddRequest: boolean; public listOfJumpType: Array; + public maxDate: Date; constructor(private serviceComm: ServiceComm, private serviceTunnel: TunnelService, private serviceTunnelFlight: TunnelFlightService, private serviceJumpType: JumpTypeService, - private translateService: TranslateService) { } + private translateService: TranslateService, + private dateService: DateService) { } ngOnInit() { this.serviceComm.forceTranslateTitle.subscribe((data) => { @@ -63,6 +65,7 @@ export class NewTunnelFlightComponent implements OnInit { }); this.updateTitle(); + this.maxDate = this.dateService.addDays(new Date(), 1); this.countDatasLoaded = 0; this.pendingAddRequest = false; this.initForm();