update no add 1 day

This commit is contained in:
AdisakKanthawilang 2025-07-18 14:00:51 +07:00
parent ea74db7005
commit 028d984ad9

View file

@ -116,7 +116,7 @@ export async function calculateGovAge(profileId: string, type: string) {
years: totalYears1,
months: totalMonths1,
days: totalDays1,
} = calculateDuration(firstStartDate, firstEndDate, true);
} = calculateDuration(firstStartDate, firstEndDate);
const records_middle = await AppDataSource.getRepository(ProfileSalary).find({
where: {
@ -145,7 +145,7 @@ export async function calculateGovAge(profileId: string, type: string) {
if (current.isGovernment === true) {
const startDate = new Date(current.dateGovernment);
const endDate = next ? new Date(next.dateGovernment) : new Date();
const { years, months, days } = calculateDuration(startDate, endDate, true);
const { years, months, days } = calculateDuration(startDate, endDate);
totalYears2 += years;
totalMonths2 += months;