mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-17 08:14:25 +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,
|
||||
|
||||
Reference in New Issue
Block a user