fix: billing text

This commit is contained in:
hamster1963
2024-12-09 11:18:41 +08:00
parent a448e5eb0d
commit fddd5edef7
4 changed files with 12 additions and 8 deletions

View File

@@ -50,7 +50,7 @@ export default function ServerCard({
} else {
daysLeft = getDaysBetweenDates(
parsedData.billingDataMod.endDate,
new Date().toISOString(),
new Date(now).toISOString(),
);
}
}

View File

@@ -57,7 +57,7 @@ export default function ServerCardInline({
} else {
daysLeft = getDaysBetweenDates(
parsedData.billingDataMod.endDate,
new Date().toISOString(),
new Date(now).toISOString(),
);
}
}
@@ -94,7 +94,11 @@ export default function ServerCardInline({
</p>
{parsedData &&
(daysLeft >= 0 ? (
<p className={cn("text-[10px] text-muted-foreground")}>
<p
className={cn("text-[10px] text-muted-foreground", {
"text-orange-600": daysLeft <= 7 && !isNeverExpire,
})}
>
: {isNeverExpire ? "永久" : daysLeft + "天"}
</p>
) : (