code refactor

This commit is contained in:
MaysWind
2023-07-16 23:05:11 +08:00
parent ed4040f2ec
commit 25f83a98e3
6 changed files with 30 additions and 8 deletions
@@ -143,7 +143,7 @@ export default {
return getDay(this.currentTime);
},
currentDayOfWeek() {
return this.$t(`datetime.${getDayOfWeekName(this.currentTime)}.short`);
return this.$locale.getWeekdayShortName(getDayOfWeekName(this.currentTime));
},
currentShortTime() {
return this.$locale.formatUnixTimeToShortTime(this.userStore, this.currentTime);
+4 -1
View File
@@ -159,7 +159,7 @@
{{ transaction.day }}
</span>
<span class="transaction-day-of-week full-line flex-direction-column">
{{ $t(`datetime.${transaction.dayOfWeek}.short`) }}
{{ getWeekdayShortName(transaction) }}
</span>
</div>
</template>
@@ -857,6 +857,9 @@ export default {
enableThousandsSeparator: this.settingsStore.appSettings.thousandsSeparator
});
},
getWeekdayShortName(transaction) {
return this.$locale.getWeekdayShortName(transaction.dayOfWeek);
},
getTransactionTypeName(type, defaultName) {
switch (type){
case this.allTransactionTypes.ModifyBalance: