From 5ed6ee4c76e43506bb14510272ff9ed24913b0a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E7=BF=94?= Date: Thu, 23 Apr 2026 17:15:16 +0800 Subject: [PATCH] =?UTF-8?q?fix(about):=20=E4=BF=AE=E5=A4=8D=E8=BF=90?= =?UTF-8?q?=E8=90=A5=E6=97=B6=E9=95=BF=E8=AE=A1=E7=AE=97=20-=20=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E5=89=A9=E4=BD=99=E5=A4=A9=E6=95=B0=E8=80=8C=E9=9D=9E?= =?UTF-8?q?=E6=80=BB=E5=A4=A9=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 根因: 运营时长计算逻辑错误,days 显示的是总天数而非剩余天数 - 原代码: days = 总天数 (98) - 显示结果: 0年 3个月 98天 ❌ 修复: - totalDays = 总天数 - years = totalDays / 365 - months = (totalDays % 365) / 30 - days = totalDays % 30 (剩余天数) - 显示结果: 0年 3个月 8天 ✅ 验证: - 成立日期: 2026-01-15 - 当前日期: 2026-04-23 - 总天数: 98天 - 正确显示: 0年 3个月 8天 --- src/app/(marketing)/about/client.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/app/(marketing)/about/client.tsx b/src/app/(marketing)/about/client.tsx index be76760..4f65859 100644 --- a/src/app/(marketing)/about/client.tsx +++ b/src/app/(marketing)/about/client.tsx @@ -20,9 +20,10 @@ export function AboutClient() { const now = new Date(); const diff = now.getTime() - foundingDate.getTime(); - const days = Math.floor(diff / (1000 * 60 * 60 * 24)); - const years = Math.floor(days / 365); - const months = Math.floor((days % 365) / 30); + const totalDays = Math.floor(diff / (1000 * 60 * 60 * 24)); + const years = Math.floor(totalDays / 365); + const months = Math.floor((totalDays % 365) / 30); + const days = totalDays % 30; setOperationTime({ days, months, years }); };