This commit is contained in:
yeongaori
2025-08-13 04:39:46 +09:00
parent 30b54933b0
commit f6b81ad909

View File

@@ -49,8 +49,8 @@ function getDischargeInfo(client, targetUserId, targetUserName, decimal, usedFul
const totalDays = calculateDateDifference(startDate, endDate) + 1;
const todayFormatted = formatDate(now);
let daysServed = new Date(todayFormatted) < new Date(startDate) ? 0 : calculateDateDifference(startDate, todayFormatted) + 1;
daysServed = Math.min(daysServed, totalDays);
const remainingDays = totalDays - daysServed;
daysServed = Math.min(daysServed, totalDays);
const [sYearStr, sMonthStr, sDayStr] = startDate.split('-');
let pastMonths = calculateMonthDifference(sYearStr, sMonthStr, String(now.getFullYear()), String(now.getMonth() + 1));
if (sDayStr === '01') pastMonths++;