Skip to content

Commit

Permalink
fix: vacation day calculation
Browse files Browse the repository at this point in the history
Due to a rounding error, users could have a vacation day to much. This is now fixed
  • Loading branch information
neferin12 committed Sep 6, 2024
1 parent 7dcdb30 commit 818e4a2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion server/src/vacationDayCalculation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ async function getTotalVacationDays(user: User) {

const contractDuration = (nextContractStartYear - contract.startYear) * 12 + nextContractStartMonth - contract.startMonth;

vacationDays += Math.ceil(contract.vacationDays * contractDuration / 12);
vacationDays += contract.vacationDays * contractDuration / 12
}

vacationDays = Math.ceil(vacationDays);
return vacationDays;

}
Expand Down

0 comments on commit 818e4a2

Please sign in to comment.