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

BIN
bun.lockb

Binary file not shown.

View File

@ -20,8 +20,8 @@
"@radix-ui/react-separator": "^1.1.0",
"@radix-ui/react-slot": "^1.1.0",
"@radix-ui/react-switch": "^1.1.1",
"@tanstack/react-query": "^5.62.2",
"@tanstack/react-query-devtools": "^5.62.2",
"@tanstack/react-query": "^5.62.3",
"@tanstack/react-query-devtools": "^5.62.3",
"@tanstack/react-table": "^8.20.5",
"@types/d3-geo": "^3.1.0",
"@types/luxon": "^3.4.2",
@ -38,15 +38,15 @@
"react-i18next": "^15.1.3",
"react-router-dom": "^7.0.2",
"recharts": "^2.14.1",
"sonner": "^1.7.0",
"sonner": "^1.7.1",
"tailwind-merge": "^2.5.5",
"tailwindcss-animate": "^1.0.7"
},
"devDependencies": {
"@eslint/js": "^9.16.0",
"@types/node": "^22.10.1",
"@types/react": "^19.0.0",
"@types/react-dom": "^19.0.0",
"@types/react": "^19.0.1",
"@types/react-dom": "^19.0.1",
"@vitejs/plugin-react-swc": "^3.7.2",
"autoprefixer": "^10.4.20",
"eslint": "^9.16.0",

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>
) : (