From 1dc7badb4daf5f3c804628c8b5c6eb892096eea3 Mon Sep 17 00:00:00 2001 From: AdisakKanthawilang Date: Fri, 18 Jul 2025 10:06:25 +0700 Subject: [PATCH] update --- src/interfaces/utils.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/interfaces/utils.ts b/src/interfaces/utils.ts index 596f53c5..7ab5583f 100644 --- a/src/interfaces/utils.ts +++ b/src/interfaces/utils.ts @@ -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;