Resolver errores de checkstyle
All checks were successful
PR Builder / Build-PR (pull_request) Successful in 2m33s

This commit is contained in:
jesus.pelaez 2024-11-07 18:53:47 -04:00
parent 6024b3fdd0
commit 3922220439
2 changed files with 48 additions and 12 deletions

View File

@ -134,16 +134,34 @@ public class RequestEmployeeView extends Div implements HasUrlParameter<String>
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)

View File

@ -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)