Skip to content

Commit

Permalink
migrate mobile home page to composition API and typescript
Browse files Browse the repository at this point in the history
  • Loading branch information
mayswind committed Feb 4, 2025
1 parent cc920cf commit 3c36378
Show file tree
Hide file tree
Showing 3 changed files with 107 additions and 163 deletions.
6 changes: 0 additions & 6 deletions src/locales/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,11 +164,6 @@ function getI18nShortYearMonthFormat(translateFn, formatTypeValue) {
return getDateTimeFormat(translateFn, ShortDateFormat.all(), ShortDateFormat.values(), 'format.shortYearMonth', defaultShortDateFormatTypeName, ShortDateFormat.Default, formatTypeValue);
}

function getI18nLongMonthDayFormat(translateFn, formatTypeValue) {
const defaultLongDateFormatTypeName = translateFn('default.longDateFormat');
return getDateTimeFormat(translateFn, LongDateFormat.all(), LongDateFormat.values(), 'format.longMonthDay', defaultLongDateFormatTypeName, LongDateFormat.Default, formatTypeValue);
}

function getI18nShortMonthDayFormat(translateFn, formatTypeValue) {
const defaultShortDateFormatTypeName = translateFn('default.shortDateFormat');
return getDateTimeFormat(translateFn, ShortDateFormat.all(), ShortDateFormat.values(), 'format.shortMonthDay', defaultShortDateFormatTypeName, ShortDateFormat.Default, formatTypeValue);
Expand Down Expand Up @@ -696,7 +691,6 @@ export function i18nFunctions(i18nGlobal) {
formatUnixTimeToLongDate: (userStore, unixTime, utcOffset, currentUtcOffset) => formatUnixTime(unixTime, getI18nLongDateFormat(i18nGlobal.t, userStore.currentUserLongDateFormat), utcOffset, currentUtcOffset),
formatUnixTimeToLongYear: (userStore, unixTime, utcOffset, currentUtcOffset) => formatUnixTime(unixTime, getI18nLongYearFormat(i18nGlobal.t, userStore.currentUserLongDateFormat), utcOffset, currentUtcOffset),
formatUnixTimeToLongYearMonth: (userStore, unixTime, utcOffset, currentUtcOffset) => formatUnixTime(unixTime, getI18nLongYearMonthFormat(i18nGlobal.t, userStore.currentUserLongDateFormat), utcOffset, currentUtcOffset),
formatUnixTimeToLongMonthDay: (userStore, unixTime, utcOffset, currentUtcOffset) => formatUnixTime(unixTime, getI18nLongMonthDayFormat(i18nGlobal.t, userStore.currentUserLongDateFormat), utcOffset, currentUtcOffset),
formatUnixTimeToLongTime: (userStore, unixTime, utcOffset, currentUtcOffset) => formatUnixTime(unixTime, getI18nLongTimeFormat(i18nGlobal.t, userStore.currentUserLongTimeFormat), utcOffset, currentUtcOffset),
formatUnixTimeToShortTime: (userStore, unixTime, utcOffset, currentUtcOffset) => formatUnixTime(unixTime, getI18nShortTimeFormat(i18nGlobal.t, userStore.currentUserShortTimeFormat), utcOffset, currentUtcOffset),
getAllTimezones: (includeSystemDefault) => getAllTimezones(includeSystemDefault, i18nGlobal.t),
Expand Down
4 changes: 2 additions & 2 deletions src/stores/overview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ export const useOverviewStore = defineStore('overview', () => {
transactionOverviewStateInvalid.value = true;
}

function loadTransactionOverview({ force, loadLast11Months }: { force: boolean, loadLast11Months: boolean }): Promise<TransactionAmountsResponse> {
function loadTransactionOverview({ force, loadLast11Months }: { force: boolean, loadLast11Months?: boolean }): Promise<TransactionAmountsResponse> {
let dateChanged = false;
let rangeChanged = false;

Expand Down Expand Up @@ -337,7 +337,7 @@ export const useOverviewStore = defineStore('overview', () => {
}

transactionOverviewData.value = data.result;
transactionOverviewOptions.value.loadLast11Months = loadLast11Months;
transactionOverviewOptions.value.loadLast11Months = !!loadLast11Months;

resolve(data.result);
}).catch(error => {
Expand Down
Loading

0 comments on commit 3c36378

Please sign in to comment.