code refactor

This commit is contained in:
MaysWind
2025-09-09 00:01:15 +08:00
parent 642e51bc0c
commit d4603a1892
21 changed files with 189 additions and 159 deletions
@@ -136,9 +136,9 @@ const {
tt,
getCurrentLanguageTextDirection,
getWeekdayShortName,
getCalendarLongYearMonthFromUnixTime,
getCalendarDisplayDayOfMonthFromUnixTime,
formatUnixTimeToShortTime,
getCalendarDayOfMonthFromUnixTime,
formatUnixTimeToGregorianLikeLongYearMonth,
formatAmountToLocalizedNumeralsWithCurrency
} = useI18n();
@@ -149,8 +149,8 @@ const fontSize = ref<number>(settingsStore.appSettings.fontSize);
const textDirection = computed<string>(() => getCurrentLanguageTextDirection());
const fontSizePreviewClassName = computed<string>(() => getFontSizePreviewClassName(fontSize.value));
const currentLongYearMonth = computed<string>(() => getCalendarLongYearMonthFromUnixTime(currentUnixTime.value));
const currentDayOfMonth = computed<string>(() => getCalendarDayOfMonthFromUnixTime(currentUnixTime.value));
const currentLongYearMonth = computed<string>(() => formatUnixTimeToGregorianLikeLongYearMonth(currentUnixTime.value));
const currentDayOfMonth = computed<string>(() => getCalendarDisplayDayOfMonthFromUnixTime(currentUnixTime.value));
const currentDayOfWeek = computed<string>(() => getWeekdayShortName(parseDateTimeFromUnixTime(currentUnixTime.value).getWeekDay()));
const currentShortTime = computed<string>(() => formatUnixTimeToShortTime(currentUnixTime.value));
+3 -3
View File
@@ -536,7 +536,7 @@ const {
getMultiWeekdayLongNames,
formatUnixTimeToLongDate,
formatUnixTimeToLongTime,
formatGregorianCalendarYearDashMonthDashDayToLongDate
formatGregorianTextualYearMonthDayToLongDate
} = useI18n();
const { showAlert, showConfirm, showToast, routeBackOnError } = useI18nUIComponents();
@@ -756,7 +756,7 @@ const transactionDisplayScheduledStartDate = computed<string>(() => {
const template = transaction.value as TransactionTemplate;
if (template.scheduledStartDate) {
return formatGregorianCalendarYearDashMonthDashDayToLongDate(template.scheduledStartDate);
return formatGregorianTextualYearMonthDayToLongDate(template.scheduledStartDate);
} else {
return tt('No limit');
}
@@ -770,7 +770,7 @@ const transactionDisplayScheduledEndDate = computed<string>(() => {
const template = transaction.value as TransactionTemplate;
if (template.scheduledEndDate) {
return formatGregorianCalendarYearDashMonthDashDayToLongDate(template.scheduledEndDate);
return formatGregorianTextualYearMonthDayToLongDate(template.scheduledEndDate);
} else {
return tt('No limit');
}
+2 -2
View File
@@ -202,7 +202,7 @@
<template #media>
<div class="display-flex flex-direction-column transaction-date" :style="getTransactionDateStyle(transaction, idx > 0 ? transactionMonthList.items[idx - 1] : null)">
<span class="transaction-day full-line flex-direction-column">
{{ getCalendarDayOfMonthFromUnixTime(transaction.time) }}
{{ getCalendarDisplayDayOfMonthFromUnixTime(transaction.time) }}
</span>
<span class="transaction-day-of-week full-line flex-direction-column" v-if="transaction.displayDayOfWeek">
{{ getWeekdayShortName(transaction.displayDayOfWeek) }}
@@ -646,7 +646,7 @@ const {
getCurrentLanguageTextDirection,
getAllTransactionTagFilterTypes,
getWeekdayShortName,
getCalendarDayOfMonthFromUnixTime
getCalendarDisplayDayOfMonthFromUnixTime
} = useI18n();
const { showAlert, showToast, routeBackOnError } = useI18nUIComponents();
+2 -2
View File
@@ -211,7 +211,7 @@
link="#" no-chevron
class="list-item-with-header-and-title list-item-no-item-after"
:header="tt('Fiscal Year Start Date')"
:title="getCalendarLongMonthDayFromFiscalYearStart(newProfile.fiscalYearStart)"
:title="formatFiscalYearStartToGregorianLikeLongMonth(newProfile.fiscalYearStart)"
@click="showFiscalYearStartSheet = true"
>
<fiscal-year-start-selection-sheet
@@ -587,7 +587,7 @@ const {
getAllLanguageOptions,
getAllCurrencies,
getCurrencyName,
getCalendarLongMonthDayFromFiscalYearStart
formatFiscalYearStartToGregorianLikeLongMonth
} = useI18n();
const { showAlert, showToast, routeBackOnError } = useI18nUIComponents();