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