From ae24bc7647f482f63dc078387948d6f1422b2e98 Mon Sep 17 00:00:00 2001 From: kkfluous Date: Tue, 2 Jun 2026 15:50:35 +0800 Subject: [PATCH] =?UTF-8?q?fix(mileage):=20=E5=B7=B2=E5=88=B0=E6=9C=9F?= =?UTF-8?q?=E5=B9=B4=E5=BA=A6=E6=98=BE=E7=A4=BA=E8=80=83=E6=A0=B8=E6=9C=9F?= =?UTF-8?q?=E6=9C=AB=E6=97=A5=E6=9C=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/mileage/StatisticsView.tsx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/modules/mileage/StatisticsView.tsx b/src/modules/mileage/StatisticsView.tsx index b32b48d..5e43830 100644 --- a/src/modules/mileage/StatisticsView.tsx +++ b/src/modules/mileage/StatisticsView.tsx @@ -38,6 +38,12 @@ function getTargetAssessment(target: TargetSummary, selectedYear?: number): Targ return target.yearlyAssessments.find(item => item.yearNumber === selectedYear) || target.yearlyAssessments[0]; } +function fmtDateLabel(date: string | null): string { + if (!date) return ''; + const [year, month, day] = date.split('-'); + return `${year}.${Number(month)}.${Number(day)}`; +} + function shortTargetName(name: string): string { // Extract the number and a short description const match = name.match(/(\d+)[辆台](.+)/); @@ -376,7 +382,9 @@ export default function StatisticsView() {

{assessment.label}已完成

{fmtKm(assessment.completed)} km

-

数据截至 {currentDateLabel}

+

+ 数据截至 {assessment.daysLeft === 0 ? fmtDateLabel(assessment.endDate) : currentDateLabel} +

{assessment.label}完成率