Commit 16c7bc8b by xuyl

上一个月日期处理

1 parent fb633749
...@@ -12,10 +12,10 @@ export const nearlyAMonth = { ...@@ -12,10 +12,10 @@ export const nearlyAMonth = {
let month = date.getMonth() + 1 let month = date.getMonth() + 1
let day = date.getDate() let day = date.getDate()
let aheadOfMonth = month == '1' ? '12' : month - 1 let aheadOfMonth = month == '1' ? '12' : month - 1
let preDays = this.mGetDate(year, aheadOfMonth)
if (aheadOfMonth == '12') { if (aheadOfMonth == '12') {
preYear = preYear - 1 preYear = preYear - 1
} }
let preDays = this.mGetDate(preYear, aheadOfMonth)
this.defalutEndTime = year + '-' + month + '-' + day this.defalutEndTime = year + '-' + month + '-' + day
if (day > preDays) { if (day > preDays) {
this.defalutStartTime = preYear + '-' + aheadOfMonth + '-' + preDays this.defalutStartTime = preYear + '-' + aheadOfMonth + '-' + preDays
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!