From 127bed102676a2eceab82eeea222624f0f9c5fb3 Mon Sep 17 00:00:00 2001 From: MaysWind Date: Sat, 7 Mar 2026 22:23:37 +0800 Subject: [PATCH] fix incorrect display when use transaction year-quarter as axis / category / series in insights explorer --- src/views/desktop/insights/tabs/ExplorerChartTab.vue | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/views/desktop/insights/tabs/ExplorerChartTab.vue b/src/views/desktop/insights/tabs/ExplorerChartTab.vue index 2da80162..a9481394 100644 --- a/src/views/desktop/insights/tabs/ExplorerChartTab.vue +++ b/src/views/desktop/insights/tabs/ExplorerChartTab.vue @@ -183,6 +183,7 @@ import { } from '@/stores/explorer.ts'; import { type NameValue, type TypeAndDisplayName } from '@/core/base.ts'; +import { NumeralSystem } from '@/core/numeral.ts'; import { Month, WeekDay } from '@/core/datetime.ts'; import { ChartSortingType, ExportMermaidChartType } from '@/core/statistics.ts'; import { @@ -468,7 +469,8 @@ function getCategoriedDataDisplayName(info: CategoriedInfo | SeriesInfo): string const parts = name.split('-'); const year = parts.length === 2 ? parts[0] : ''; const quarter = parts.length === 2 ? parseInt(parts[1] as string) : 0; - const dateTime = year && quarter ? parseDateTimeFromString(`${year}-${quarter * 3}`, TransactionExplorerDimensionType.YearMonth) : undefined; + const quarterLastMonth = quarter * 3; + const dateTime = year && quarterLastMonth ? parseDateTimeFromString(`${year}-${quarterLastMonth.toString(10).padStart(2, NumeralSystem.WesternArabicNumerals.digitZero)}`, TransactionExplorerDimensionType.YearMonth) : undefined; displayName = dateTime ? formatDateTimeToGregorianLikeYearQuarter(dateTime) : tt('Unknown'); } else if (dimession === TransactionExplorerDataDimension.DateTimeByYear.value) { const dateTime = parseDateTimeFromString(name, dimessionType);