En-desarrollo #65
@ -134,16 +134,34 @@ public class RequestEmployeeView extends Div implements HasUrlParameter<String>
|
|||||||
LocalDate today = LocalDate.now();
|
LocalDate today = LocalDate.now();
|
||||||
|
|
||||||
boolean hasAnniversaryPassed = entryDate.getMonthValue() < today.getMonthValue()
|
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) {
|
if (hasAnniversaryPassed) {
|
||||||
previousVacationYearDate = LocalDate.of(today.getYear() - 1, entryDate.getMonth(), entryDate.getDayOfMonth());
|
previousVacationYearDate = LocalDate.of(
|
||||||
currentVacationYearDate = LocalDate.of(today.getYear(), entryDate.getMonth(), entryDate.getDayOfMonth());
|
today.getYear() - 1,
|
||||||
|
entryDate.getMonth(),
|
||||||
|
entryDate.getDayOfMonth()
|
||||||
|
);
|
||||||
|
currentVacationYearDate = LocalDate.of(
|
||||||
|
today.getYear(),
|
||||||
|
entryDate.getMonth(),
|
||||||
|
entryDate.getDayOfMonth()
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
previousVacationYearDate = LocalDate.of(today.getYear() - 2, entryDate.getMonth(), entryDate.getDayOfMonth());
|
previousVacationYearDate = LocalDate.of(
|
||||||
currentVacationYearDate = LocalDate.of(today.getYear() - 1, entryDate.getMonth(), entryDate.getDayOfMonth());
|
today.getYear() - 2,
|
||||||
|
entryDate.getMonth(),
|
||||||
|
entryDate.getDayOfMonth()
|
||||||
|
);
|
||||||
|
currentVacationYearDate = LocalDate.of(
|
||||||
|
today.getYear() - 1,
|
||||||
|
entryDate.getMonth(),
|
||||||
|
entryDate.getDayOfMonth()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return calculateVacationDaysSinceEntry(entryDate, previousVacationYearDate)
|
return calculateVacationDaysSinceEntry(entryDate, previousVacationYearDate)
|
||||||
|
@ -203,16 +203,34 @@ public class RequestsListView extends Main {
|
|||||||
LocalDate today = LocalDate.now();
|
LocalDate today = LocalDate.now();
|
||||||
|
|
||||||
boolean hasAnniversaryPassed = entryDate.getMonthValue() < today.getMonthValue()
|
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) {
|
if (hasAnniversaryPassed) {
|
||||||
previousVacationYearDate = LocalDate.of(today.getYear() - 1, entryDate.getMonth(), entryDate.getDayOfMonth());
|
previousVacationYearDate = LocalDate.of(
|
||||||
currentVacationYearDate = LocalDate.of(today.getYear(), entryDate.getMonth(), entryDate.getDayOfMonth());
|
today.getYear() - 1,
|
||||||
|
entryDate.getMonth(),
|
||||||
|
entryDate.getDayOfMonth()
|
||||||
|
);
|
||||||
|
currentVacationYearDate = LocalDate.of(
|
||||||
|
today.getYear(),
|
||||||
|
entryDate.getMonth(),
|
||||||
|
entryDate.getDayOfMonth()
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
previousVacationYearDate = LocalDate.of(today.getYear() - 2, entryDate.getMonth(), entryDate.getDayOfMonth());
|
previousVacationYearDate = LocalDate.of(
|
||||||
currentVacationYearDate = LocalDate.of(today.getYear() - 1, entryDate.getMonth(), entryDate.getDayOfMonth());
|
today.getYear() - 2,
|
||||||
|
entryDate.getMonth(),
|
||||||
|
entryDate.getDayOfMonth()
|
||||||
|
);
|
||||||
|
currentVacationYearDate = LocalDate.of(
|
||||||
|
today.getYear() - 1,
|
||||||
|
entryDate.getMonth(),
|
||||||
|
entryDate.getDayOfMonth()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return calculateVacationDaysSinceEntry(entryDate, previousVacationYearDate)
|
return calculateVacationDaysSinceEntry(entryDate, previousVacationYearDate)
|
||||||
|
Loading…
Reference in New Issue
Block a user