浏览代码

wip: black

Frank 1 月之前
父节点
当前提交
2e875b2d65
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      packages/console/core/src/util/date.ts

+ 1 - 1
packages/console/core/src/util/date.ts

@@ -1,7 +1,7 @@
 export function getWeekBounds(date: Date) {
 export function getWeekBounds(date: Date) {
   const dayOfWeek = date.getUTCDay()
   const dayOfWeek = date.getUTCDay()
   const start = new Date(date)
   const start = new Date(date)
-  start.setUTCDate(date.getUTCDate() - dayOfWeek)
+  start.setUTCDate(date.getUTCDate() - dayOfWeek + 1)
   start.setUTCHours(0, 0, 0, 0)
   start.setUTCHours(0, 0, 0, 0)
   const end = new Date(start)
   const end = new Date(start)
   end.setUTCDate(start.getUTCDate() + 7)
   end.setUTCDate(start.getUTCDate() + 7)