support date display type (Gregorian and Buddhist)

This commit is contained in:
MaysWind
2025-08-27 00:58:22 +08:00
parent 23ffdbb163
commit c099443783
32 changed files with 776 additions and 126 deletions
@@ -8,7 +8,7 @@ import { useAccountsStore } from '@/stores/account.ts';
import { useTransactionCategoriesStore } from '@/stores/transactionCategory.ts';
import type { TypeAndDisplayName } from '@/core/base.ts';
import { type WeekDayValue, KnownDateTimeFormat } from '@/core/datetime.ts';
import type { WeekDayValue } from '@/core/datetime.ts';
import { TransactionType } from '@/core/transaction.ts';
import { KnownFileType } from '@/core/file.ts';
import type { Account } from '@/models/account.ts';
@@ -23,8 +23,7 @@ import { replaceAll } from '@/lib/common.ts';
import {
getUtcOffsetByUtcOffsetMinutes,
getTimezoneOffsetMinutes,
parseDateTimeFromUnixTime,
formatUnixTime
parseDateTimeFromUnixTime
} from '@/lib/datetime.ts';
export function useReconciliationStatementPageBase() {
@@ -32,6 +31,7 @@ export function useReconciliationStatementPageBase() {
tt,
getAllAccountBalanceTrendChartTypes,
getAllStatisticsDateAggregationTypesWithShortName,
formatUnixTimeToDefaultDateTimeWithoutLocaleOptions,
formatUnixTimeToLongDateTime,
formatUnixTimeToLongDate,
formatUnixTimeToShortTime,
@@ -241,7 +241,7 @@ export function useReconciliationStatementPageBase() {
}
return [
formatUnixTime(transactionTime, KnownDateTimeFormat.DefaultDateTime.format),
formatUnixTimeToDefaultDateTimeWithoutLocaleOptions(transactionTime),
type,
categoryName,
displayAmount,
+11 -2
View File
@@ -7,6 +7,7 @@ import { useAccountsStore } from '@/stores/account.ts';
import { useOverviewStore } from '@/stores/overview.ts';
import type { TypeAndDisplayName } from '@/core/base.ts';
import { DateDisplayType } from '@/core/calendar.ts';
import { WeekDay } from '@/core/datetime.ts';
import { type LocalizedDigitGroupingType, NumeralSystem, DecimalSeparator, DigitGroupingSymbol } from '@/core/numeral.ts';
@@ -22,6 +23,8 @@ export function useUserProfilePageBase() {
getDefaultCurrency,
getDefaultFirstDayOfWeek,
getAllWeekDays,
getAllCalendarDisplayTypes,
getAllDateDisplayTypes,
getAllLongDateFormats,
getAllShortDateFormats,
getAllLongTimeFormats,
@@ -58,8 +61,10 @@ export function useUserProfilePageBase() {
const allVisibleAccounts = computed<Account[]>(() => accountsStore.allVisiblePlainAccounts);
const allVisibleCategorizedAccounts = computed<CategorizedAccount[]>(() => getCategorizedAccounts(allVisibleAccounts.value));
const allWeekDays = computed<TypeAndDisplayName[]>(() => getAllWeekDays());
const allLongDateFormats = computed<TypeAndDisplayName[]>(() => getAllLongDateFormats());
const allShortDateFormats = computed<TypeAndDisplayName[]>(() => getAllShortDateFormats());
const allCalendarDisplayTypes = computed<TypeAndDisplayName[]>(() => getAllCalendarDisplayTypes());
const allDateDisplayTypes = computed<TypeAndDisplayName[]>(() => getAllDateDisplayTypes());
const allLongDateFormats = computed<TypeAndDisplayName[]>(() => getAllLongDateFormats(DateDisplayType.valueOf(newProfile.value.dateDisplayType)?.calendarType));
const allShortDateFormats = computed<TypeAndDisplayName[]>(() => getAllShortDateFormats(DateDisplayType.valueOf(newProfile.value.dateDisplayType)?.calendarType));
const allLongTimeFormats = computed<TypeAndDisplayName[]>(() => getAllLongTimeFormats());
const allShortTimeFormats = computed<TypeAndDisplayName[]>(() => getAllShortTimeFormats());
const allFiscalYearFormats = computed<TypeAndDisplayName[]>(() => getAllFiscalYearFormats());
@@ -105,6 +110,8 @@ export function useUserProfilePageBase() {
newProfile.value.defaultCurrency === oldProfile.value.defaultCurrency &&
newProfile.value.fiscalYearStart === oldProfile.value.fiscalYearStart &&
newProfile.value.firstDayOfWeek === oldProfile.value.firstDayOfWeek &&
newProfile.value.calendarDisplayType === oldProfile.value.calendarDisplayType &&
newProfile.value.dateDisplayType === oldProfile.value.dateDisplayType &&
newProfile.value.longDateFormat === oldProfile.value.longDateFormat &&
newProfile.value.shortDateFormat === oldProfile.value.shortDateFormat &&
newProfile.value.longTimeFormat === oldProfile.value.longTimeFormat &&
@@ -197,6 +204,8 @@ export function useUserProfilePageBase() {
allVisibleAccounts,
allVisibleCategorizedAccounts,
allWeekDays,
allCalendarDisplayTypes,
allDateDisplayTypes,
allLongDateFormats,
allShortDateFormats,
allLongTimeFormats,