From be129cd3c68fafca256413e02d856dce303c2867 Mon Sep 17 00:00:00 2001 From: MaysWind Date: Mon, 4 Aug 2025 23:33:13 +0800 Subject: [PATCH] modify function name --- src/components/base/MonthlyTrendsChartBase.ts | 4 ++-- src/lib/statistics.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/base/MonthlyTrendsChartBase.ts b/src/components/base/MonthlyTrendsChartBase.ts index 18046caa..8e641dbf 100644 --- a/src/components/base/MonthlyTrendsChartBase.ts +++ b/src/components/base/MonthlyTrendsChartBase.ts @@ -14,7 +14,7 @@ import type { ColorValue } from '@/core/color.ts'; import { DEFAULT_ICON_COLOR } from '@/consts/color.ts'; import type { YearMonthItems } from '@/models/transaction.ts'; -import { getAllDateRanges } from '@/lib/statistics.ts'; +import { getAllDateRangesFromItems } from '@/lib/statistics.ts'; export interface CommonMonthlyTrendsChartProps { items: YearMonthItems[]; @@ -42,7 +42,7 @@ export interface MonthlyTrendsBarChartClickEvent { export function useMonthlyTrendsChartBase(props: CommonMonthlyTrendsChartProps) { const { tt } = useI18n(); - const allDateRanges = computed(() => getAllDateRanges(props.items, props.startYearMonth, props.endYearMonth, props.fiscalYearStart, props.dateAggregationType)); + const allDateRanges = computed(() => getAllDateRangesFromItems(props.items, props.startYearMonth, props.endYearMonth, props.fiscalYearStart, props.dateAggregationType)); function getItemName(name: string): string { return props.translateName ? tt(name) : name; diff --git a/src/lib/statistics.ts b/src/lib/statistics.ts index 291ee128..8290379c 100644 --- a/src/lib/statistics.ts +++ b/src/lib/statistics.ts @@ -48,7 +48,7 @@ export function sortStatisticsItems(items: YearMonthItems[], startYearMonth: Year1BasedMonth | string, endYearMonth: Year1BasedMonth | string, fiscalYearStart: number, dateAggregationType: number): YearUnixTime[] | FiscalYearUnixTime[] | YearQuarterUnixTime[] | YearMonthUnixTime[] { +export function getAllDateRangesFromItems(items: YearMonthItems[], startYearMonth: Year1BasedMonth | string, endYearMonth: Year1BasedMonth | string, fiscalYearStart: number, dateAggregationType: number): YearUnixTime[] | FiscalYearUnixTime[] | YearQuarterUnixTime[] | YearMonthUnixTime[] { if ((!startYearMonth || !endYearMonth) && items && items.length) { let minYear = Number.MAX_SAFE_INTEGER, minMonth = Number.MAX_SAFE_INTEGER, maxYear = 0, maxMonth = 0;