From cfd5599d327afd1e4cb731482c65dbc78ff51949 Mon Sep 17 00:00:00 2001 From: ricardo051199 Date: Sun, 3 Nov 2024 23:40:13 -0400 Subject: [PATCH] =?UTF-8?q?#55=20Perfil=20de=20Personal=20Administrativo?= =?UTF-8?q?=20-=20A=C3=B1adir=20Vacaciones=20del=20Empleado=20(No=20acepta?= =?UTF-8?q?r=20fechas=20pasadas)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/primefactorsolutions/views/RequestRegisterView.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/com/primefactorsolutions/views/RequestRegisterView.java b/src/main/java/com/primefactorsolutions/views/RequestRegisterView.java index 41f37d1..8abc086 100644 --- a/src/main/java/com/primefactorsolutions/views/RequestRegisterView.java +++ b/src/main/java/com/primefactorsolutions/views/RequestRegisterView.java @@ -240,6 +240,11 @@ public class RequestRegisterView extends VerticalLayout { int startYear = calculateStartYear(previousRequests); startDate = determineStartDate(vacation, startYear); + + if (startDate.isBefore(LocalDate.now())) { + startDate = determineStartDate(vacation, startYear + 1); + } + if (startDate != null) { endDate = startDate.plusDays(vacation.getExpiration().intValue() - 1); } else {