diff --git a/src/locales/en.js b/src/locales/en.js index 01917764..5938d717 100644 --- a/src/locales/en.js +++ b/src/locales/en.js @@ -46,6 +46,42 @@ export default { }, 'Sunday': { 'short': 'Sun' + }, + 'January': { + 'long': 'January' + }, + 'February': { + 'long': 'February' + }, + 'March': { + 'long': 'March' + }, + 'April': { + 'long': 'April' + }, + 'May': { + 'long': 'May' + }, + 'June': { + 'long': 'June' + }, + 'July': { + 'long': 'July' + }, + 'August': { + 'long': 'August' + }, + 'September': { + 'long': 'September' + }, + 'October': { + 'long': 'October' + }, + 'November': { + 'long': 'November' + }, + 'December': { + 'long': 'December' } }, 'currency': { @@ -503,6 +539,7 @@ export default { 'This Week': 'This Week', 'This Month': 'This Month', 'This Year': 'This Year', + 'Income of this month': 'Income of this month', 'Unable to get transaction overview': 'Unable to get transaction overview', 'Net assets': 'Net assets', 'Total assets': 'Total assets', diff --git a/src/locales/zh_Hans.js b/src/locales/zh_Hans.js index 274b5f42..b153925f 100644 --- a/src/locales/zh_Hans.js +++ b/src/locales/zh_Hans.js @@ -46,6 +46,42 @@ export default { }, 'Sunday': { 'short': '周日' + }, + 'January': { + 'long': '1月' + }, + 'February': { + 'long': '2月' + }, + 'March': { + 'long': '3月' + }, + 'April': { + 'long': '4月' + }, + 'May': { + 'long': '5月' + }, + 'June': { + 'long': '6月' + }, + 'July': { + 'long': '7月' + }, + 'August': { + 'long': '8月' + }, + 'September': { + 'long': '9月' + }, + 'October': { + 'long': '10月' + }, + 'November': { + 'long': '11月' + }, + 'December': { + 'long': '12月' } }, 'currency': { @@ -503,6 +539,7 @@ export default { 'This Week': '本周', 'This Month': '本月', 'This Year': '今年', + 'Income of this month': '当月收入', 'Unable to get transaction overview': '无法获取交易概要', 'Net assets': '净资产', 'Total assets': '总资产', diff --git a/src/views/mobile/Home.vue b/src/views/mobile/Home.vue index 679fb6b9..3904fcf7 100644 --- a/src/views/mobile/Home.vue +++ b/src/views/mobile/Home.vue @@ -4,6 +4,33 @@ + + +

+ MM·Expense + + {{ dateRange.thisMonth.startTime | moment('MMMM') | monthNameLocalizedKey | t }} + · + {{ $t('Expense') }} + +

+

+ 0.00 USD + {{ thisMonthExpense | amount(showAmountInHomePage) | currency(defaultCurrency) }} + + + +

+

+ Income of this month 0.00 USD + + {{ $t('Income of this month') }} + {{ thisMonthIncome | amount(showAmountInHomePage) | currency(defaultCurrency) }} + +

+
+
+ @@ -153,6 +180,20 @@ export default { }, defaultCurrency() { return this.$store.getters.currentUserDefaultCurrency || this.$t('default.currency'); + }, + thisMonthExpense() { + if (!this.$store.state.transactionOverview || !this.$store.state.transactionOverview.thisMonth) { + return 0; + } + + return this.$store.state.transactionOverview.thisMonth.expenseAmount; + }, + thisMonthIncome() { + if (!this.$store.state.transactionOverview || !this.$store.state.transactionOverview.thisMonth) { + return 0; + } + + return this.$store.state.transactionOverview.thisMonth.incomeAmount; } }, created() { @@ -242,18 +283,32 @@ export default { } return amount; + }, + monthNameLocalizedKey(monthName) { + return `datetime.${monthName}.long`; } } }