This commit is contained in:
白菜
2025-09-08 18:01:48 +08:00
parent 2742f874ce
commit cc3164a423
8 changed files with 17 additions and 17 deletions

View File

@ -38,9 +38,9 @@ export default {
}
},
methods: {
init(){
init(today=false){
const now = new Date(),formatNow = formatDate(now);
const weekAgo = formatDate(new Date(now.getTime() - 7 * 24 * 60 * 60 * 1000))
const weekAgo = formatDate(today ? new Date(now.getTime()) : new Date(now.getTime() - 7 * 24 * 60 * 60 * 1000))
this.dateRange = [weekAgo, formatNow];
this.defaultDateRange=[weekAgo, formatNow];
this.$emit('updateDate',this.dateRange)