This commit is contained in:
Bright 2025-09-01 11:15:30 +07:00
parent 9aab92ee3f
commit 7e474f6652

View file

@ -93,9 +93,12 @@ export class ProfileSalaryController extends Controller {
profileId: x.id,
positionName: calDayDiff.positionName,
days_diff: calDayDiff.days_diff,
Years: (calDayDiff.days_diff / 365.2524).toFixed(4),
Months: ((calDayDiff.days_diff / 30.4375) % 12).toFixed(4),
Days: (calDayDiff.days_diff % 30.4375).toFixed(4),
// Years: (calDayDiff.days_diff / 365.2524).toFixed(4),
// Months: ((calDayDiff.days_diff / 30.4375) % 12).toFixed(4),
// Days: (calDayDiff.days_diff % 30.4375).toFixed(4),
Years: Math.floor(calDayDiff.days_diff / 365.2524),
Months: Math.floor((calDayDiff.days_diff / 30.4375) % 12),
Days: Math.floor(calDayDiff.days_diff % 30.4375),
};
// data.push(_mapData);
await this.positionOfficerRepo.save(mapData);
@ -143,9 +146,12 @@ export class ProfileSalaryController extends Controller {
profileEmployeeId: x.id,
positionName: calDayDiff.positionName,
days_diff: calDayDiff.days_diff,
Years: (calDayDiff.days_diff / 365.2524).toFixed(4),
Months: ((calDayDiff.days_diff / 30.4375) % 12).toFixed(4),
Days: (calDayDiff.days_diff % 30.4375).toFixed(4),
// Years: (calDayDiff.days_diff / 365.2524).toFixed(4),
// Months: ((calDayDiff.days_diff / 30.4375) % 12).toFixed(4),
// Days: (calDayDiff.days_diff % 30.4375).toFixed(4),
Years: Math.floor(calDayDiff.days_diff / 365.2524),
Months: Math.floor((calDayDiff.days_diff / 30.4375) % 12),
Days: Math.floor(calDayDiff.days_diff % 30.4375),
};
// data.push(_mapData);
await this.positionEmployeeRepo.save(mapData);