update
This commit is contained in:
parent
6868327430
commit
1dc7badb4d
1 changed files with 2 additions and 2 deletions
|
|
@ -141,8 +141,8 @@ export async function calculateGovAge(profileId: string, type: string) {
|
||||||
if (current.isGovernment === true) {
|
if (current.isGovernment === true) {
|
||||||
const startDate = new Date(current.dateGovernment);
|
const startDate = new Date(current.dateGovernment);
|
||||||
const endDate = next ? new Date(next.dateGovernment) : new Date();
|
const endDate = next ? new Date(next.dateGovernment) : new Date();
|
||||||
|
const adjustedEndDate = new Date(endDate.getTime() + 86400000) //เพิ่ม 1 วัน (วันปัจจุบัน)
|
||||||
const { years, months, days } = calculateDuration(startDate, endDate);
|
const { years, months, days } = calculateDuration(startDate, adjustedEndDate);
|
||||||
|
|
||||||
totalYears2 += years;
|
totalYears2 += years;
|
||||||
totalMonths2 += months;
|
totalMonths2 += months;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue