|
@@ -38,6 +38,21 @@ export default { |
|
|
Sunday: this.fmtDate(SundayTime) |
|
|
Sunday: this.fmtDate(SundayTime) |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
weekday2() { //根据今天得到周一与周日的时间 |
|
|
|
|
|
var now = new Date(); |
|
|
|
|
|
var nowTime = now.getTime(); |
|
|
|
|
|
var day = now.getDay(); |
|
|
|
|
|
//显示周一 |
|
|
|
|
|
var MondayTime = nowTime - (day - 1) * this.oneDayTime() ; |
|
|
|
|
|
//显示周日 |
|
|
|
|
|
var SundayTime = nowTime + (14 - day) * this.oneDayTime() ; |
|
|
|
|
|
return { |
|
|
|
|
|
MondayTime: MondayTime, |
|
|
|
|
|
Monday: this.fmtDate(MondayTime), |
|
|
|
|
|
SundayTime: SundayTime, |
|
|
|
|
|
Sunday: this.fmtDate(SundayTime) |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
compare (key) { |
|
|
compare (key) { |
|
|
return (obj1, obj2) => { |
|
|
return (obj1, obj2) => { |
|
|
let value1 = obj1[key] |
|
|
let value1 = obj1[key] |
|
|