This commit is contained in:
AdisakKanthawilang 2025-07-18 10:06:25 +07:00
parent 6868327430
commit 1dc7badb4d

View file

@ -141,8 +141,8 @@ 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);
const adjustedEndDate = new Date(endDate.getTime() + 86400000) //เพิ่ม 1 วัน (วันปัจจุบัน)
const { years, months, days } = calculateDuration(startDate, adjustedEndDate);
totalYears2 += years;
totalMonths2 += months;