From bb9abfa47099d5c8c982fc320d3f6bf806e0c435 Mon Sep 17 00:00:00 2001 From: xiaoxia Date: Mon, 27 Jul 2026 15:29:18 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=88=A0=E9=99=A4=20utils.ts=EF=BC=88?= =?UTF-8?q?=E5=B7=B2=E9=87=8D=E5=91=BD=E5=90=8D=E4=B8=BA=20detailUtils.ts?= =?UTF-8?q?=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/web/src/pages/products/utils.ts | 27 --------------------------- 1 file changed, 27 deletions(-) delete mode 100644 apps/web/src/pages/products/utils.ts diff --git a/apps/web/src/pages/products/utils.ts b/apps/web/src/pages/products/utils.ts deleted file mode 100644 index 52d11b67a..000000000 --- a/apps/web/src/pages/products/utils.ts +++ /dev/null @@ -1,27 +0,0 @@ -/** 格式化时长(秒 → "MM:SS") */ -export const formatDuration = (seconds: number): string => { - if (!seconds || seconds <= 0) return "00:00" - const m = Math.floor(seconds / 60) - const s = Math.floor(seconds % 60) - return `${String(m).padStart(2, "0")}:${String(s).padStart(2, "0")}` -} - -/** 格式化文件大小(MB) */ -export const formatFileSize = (mb: number): string => { - if (!mb || mb <= 0) return "-" - if (mb < 1024) return `${mb.toFixed(1)} MB` - return `${(mb / 1024).toFixed(2)} GB` -} - -/** 格式化日期 */ -export const formatDate = (dateStr: string): string => { - if (!dateStr) return "-" - const d = new Date(dateStr) - return d.toLocaleDateString("zh-CN", { - year: "numeric", - month: "2-digit", - day: "2-digit", - hour: "2-digit", - minute: "2-digit", - }) -}