11.9
This commit is contained in:
parent
f814c0fa37
commit
c93515f1f2
@ -229,12 +229,23 @@ export default {
|
|||||||
this.timeIndex = index
|
this.timeIndex = index
|
||||||
this.disabled = true
|
this.disabled = true
|
||||||
if (this.timeList[index] == '今日') {
|
if (this.timeList[index] == '今日') {
|
||||||
let start = new Date()
|
let start = new Date();
|
||||||
start.setHours(0)
|
start.setHours(0);
|
||||||
start.setMinutes(0)
|
start.setMinutes(0);
|
||||||
start.setSeconds(0)
|
start.setSeconds(0);
|
||||||
start.setMilliseconds(0)
|
start.setMilliseconds(0);
|
||||||
this.value2 = [start, new Date()]
|
let end = new Date();
|
||||||
|
function formatDate(date) {
|
||||||
|
let year = date.getFullYear();
|
||||||
|
let month = String(date.getMonth() + 1).padStart(2, '0');
|
||||||
|
let day = String(date.getDate()).padStart(2, '0');
|
||||||
|
let hours = String(date.getHours()).padStart(2, '0');
|
||||||
|
let minutes = String(date.getMinutes()).padStart(2, '0');
|
||||||
|
let seconds = String(date.getSeconds()).padStart(2, '0');
|
||||||
|
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
|
||||||
|
}
|
||||||
|
this.value2 = [formatDate(start), formatDate(end)];
|
||||||
|
console.log(this.value2);
|
||||||
} else if (this.timeList[index] == '近一周') {
|
} else if (this.timeList[index] == '近一周') {
|
||||||
let nowDate = new Date()
|
let nowDate = new Date()
|
||||||
let oneWeekAgo = new Date(nowDate.getTime() - 6 * 24 * 60 * 60 * 1000)
|
let oneWeekAgo = new Date(nowDate.getTime() - 6 * 24 * 60 * 60 * 1000)
|
||||||
|
Loading…
Reference in New Issue
Block a user