From 39222204390bfd9162d231202dc2d4fbf00491b0 Mon Sep 17 00:00:00 2001 From: ricardo051199 Date: Thu, 7 Nov 2024 18:53:47 -0400 Subject: [PATCH] Resolver errores de checkstyle --- .../views/RequestEmployeeView.java | 30 +++++++++++++++---- .../views/RequestsListView.java | 30 +++++++++++++++---- 2 files changed, 48 insertions(+), 12 deletions(-) diff --git a/src/main/java/com/primefactorsolutions/views/RequestEmployeeView.java b/src/main/java/com/primefactorsolutions/views/RequestEmployeeView.java index 526aa37..50445d4 100644 --- a/src/main/java/com/primefactorsolutions/views/RequestEmployeeView.java +++ b/src/main/java/com/primefactorsolutions/views/RequestEmployeeView.java @@ -134,16 +134,34 @@ public class RequestEmployeeView extends Div implements HasUrlParameter LocalDate today = LocalDate.now(); boolean hasAnniversaryPassed = entryDate.getMonthValue() < today.getMonthValue() - || (entryDate.getMonthValue() == today.getMonthValue() && entryDate.getDayOfMonth() <= today.getDayOfMonth()); + || (entryDate.getMonthValue() == today.getMonthValue() && entryDate.getDayOfMonth() + <= today.getDayOfMonth()); - LocalDate previousVacationYearDate, currentVacationYearDate; + LocalDate previousVacationYearDate; + LocalDate currentVacationYearDate; if (hasAnniversaryPassed) { - previousVacationYearDate = LocalDate.of(today.getYear() - 1, entryDate.getMonth(), entryDate.getDayOfMonth()); - currentVacationYearDate = LocalDate.of(today.getYear(), entryDate.getMonth(), entryDate.getDayOfMonth()); + previousVacationYearDate = LocalDate.of( + today.getYear() - 1, + entryDate.getMonth(), + entryDate.getDayOfMonth() + ); + currentVacationYearDate = LocalDate.of( + today.getYear(), + entryDate.getMonth(), + entryDate.getDayOfMonth() + ); } else { - previousVacationYearDate = LocalDate.of(today.getYear() - 2, entryDate.getMonth(), entryDate.getDayOfMonth()); - currentVacationYearDate = LocalDate.of(today.getYear() - 1, entryDate.getMonth(), entryDate.getDayOfMonth()); + previousVacationYearDate = LocalDate.of( + today.getYear() - 2, + entryDate.getMonth(), + entryDate.getDayOfMonth() + ); + currentVacationYearDate = LocalDate.of( + today.getYear() - 1, + entryDate.getMonth(), + entryDate.getDayOfMonth() + ); } return calculateVacationDaysSinceEntry(entryDate, previousVacationYearDate) diff --git a/src/main/java/com/primefactorsolutions/views/RequestsListView.java b/src/main/java/com/primefactorsolutions/views/RequestsListView.java index c238ca4..73c2cbf 100644 --- a/src/main/java/com/primefactorsolutions/views/RequestsListView.java +++ b/src/main/java/com/primefactorsolutions/views/RequestsListView.java @@ -203,16 +203,34 @@ public class RequestsListView extends Main { LocalDate today = LocalDate.now(); boolean hasAnniversaryPassed = entryDate.getMonthValue() < today.getMonthValue() - || (entryDate.getMonthValue() == today.getMonthValue() && entryDate.getDayOfMonth() <= today.getDayOfMonth()); + || (entryDate.getMonthValue() == today.getMonthValue() && entryDate.getDayOfMonth() + <= today.getDayOfMonth()); - LocalDate previousVacationYearDate, currentVacationYearDate; + LocalDate previousVacationYearDate; + LocalDate currentVacationYearDate; if (hasAnniversaryPassed) { - previousVacationYearDate = LocalDate.of(today.getYear() - 1, entryDate.getMonth(), entryDate.getDayOfMonth()); - currentVacationYearDate = LocalDate.of(today.getYear(), entryDate.getMonth(), entryDate.getDayOfMonth()); + previousVacationYearDate = LocalDate.of( + today.getYear() - 1, + entryDate.getMonth(), + entryDate.getDayOfMonth() + ); + currentVacationYearDate = LocalDate.of( + today.getYear(), + entryDate.getMonth(), + entryDate.getDayOfMonth() + ); } else { - previousVacationYearDate = LocalDate.of(today.getYear() - 2, entryDate.getMonth(), entryDate.getDayOfMonth()); - currentVacationYearDate = LocalDate.of(today.getYear() - 1, entryDate.getMonth(), entryDate.getDayOfMonth()); + previousVacationYearDate = LocalDate.of( + today.getYear() - 2, + entryDate.getMonth(), + entryDate.getDayOfMonth() + ); + currentVacationYearDate = LocalDate.of( + today.getYear() - 1, + entryDate.getMonth(), + entryDate.getDayOfMonth() + ); } return calculateVacationDaysSinceEntry(entryDate, previousVacationYearDate)