mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-15 23:47:33 +08:00
fix month format error in ios
This commit is contained in:
@@ -57,6 +57,17 @@ function getMonth(date) {
|
||||
return moment(date).month() + 1;
|
||||
}
|
||||
|
||||
function getYearAndMonth(date) {
|
||||
const year = getYear(date);
|
||||
let month = getMonth(date);
|
||||
|
||||
if (month < 10) {
|
||||
month = '0' + month;
|
||||
}
|
||||
|
||||
return `${year}-${month}`;
|
||||
}
|
||||
|
||||
function getDay(date) {
|
||||
return moment(date).date();
|
||||
}
|
||||
@@ -428,6 +439,7 @@ export default {
|
||||
getUnixTime,
|
||||
getYear,
|
||||
getMonth,
|
||||
getYearAndMonth,
|
||||
getDay,
|
||||
getDayOfWeek,
|
||||
copyObjectTo,
|
||||
|
||||
@@ -504,6 +504,7 @@ export default {
|
||||
|
||||
const transactionYear = this.$utilities.getYear(transactionTime);
|
||||
const transactionMonth = this.$utilities.getMonth(transactionTime);
|
||||
const transactionYearMonth = this.$utilities.getYearAndMonth(transactionTime);
|
||||
|
||||
if (currentMonthList && currentMonthList.year === transactionYear && currentMonthList.month === transactionMonth) {
|
||||
currentMonthList.items.push(transaction);
|
||||
@@ -534,7 +535,7 @@ export default {
|
||||
this.transactions.push({
|
||||
year: transactionYear,
|
||||
month: transactionMonth,
|
||||
yearMonth: `${transactionYear}-${transactionMonth}`,
|
||||
yearMonth: transactionYearMonth,
|
||||
opened: autoExpand,
|
||||
items: []
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user