|
|
@@ -73,12 +73,15 @@ const shortcuts = [
|
|
|
{
|
|
|
text: '上周',
|
|
|
value: () => {
|
|
|
- const end = new Date();
|
|
|
- end.setDate(end.getDate() - end.getDay())
|
|
|
+ const now = new Date();
|
|
|
+ const year = now.getFullYear();
|
|
|
+ const month = now.getMonth();
|
|
|
+ const date = now.getDate()
|
|
|
+ const day = now.getDay()
|
|
|
+
|
|
|
+ const start = new Date(year, month, date - day - 6)
|
|
|
+ const end = new Date(year, month, date - day)
|
|
|
end.setHours(23, 59, 59, 999)
|
|
|
- const start = new Date(end);
|
|
|
- start.setDate(start.getDate() - 7)
|
|
|
- start.setHours(0, 0, 0, 0)
|
|
|
return [start,end]
|
|
|
},
|
|
|
},
|