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)