This commit is contained in:
parent
f1b3f1d953
commit
5516f71bfc
@ -295,11 +295,15 @@ public class localvacaService {
|
|||||||
LocalDate today = LocalDate.now();
|
LocalDate today = LocalDate.now();
|
||||||
int currentYear = today.getYear();
|
int currentYear = today.getYear();
|
||||||
int hireYear = hireDate.getYear();
|
int hireYear = hireDate.getYear();
|
||||||
int hireMonth = hireDate.getMonthValue();
|
|
||||||
|
// 입사일부터 오늘까지의 전체 근속 개월 수 계산
|
||||||
|
int workMonths = (int) ChronoUnit.MONTHS.between(hireDate, today);
|
||||||
|
|
||||||
// 올해 입사자 → 1년 미만: 입사월 이후로 계산
|
// 올해 입사자 → 1년 미만: 입사월 이후로 계산
|
||||||
if (hireYear == currentYear) {
|
if (hireYear == currentYear) {
|
||||||
return 12 - hireMonth;
|
return 12 - workMonths;
|
||||||
|
}else if(workMonths < 12) {
|
||||||
|
return 12;
|
||||||
}
|
}
|
||||||
|
|
||||||
int totalVacation = 15;
|
int totalVacation = 15;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user