mirror of
https://github.com/anomalyco/opencode.git
synced 2026-04-29 21:19:48 +00:00
wip: zen
wip: zen
This commit is contained in:
parent
cf97633d7d
commit
52fbd16e08
16 changed files with 4131 additions and 106 deletions
9
packages/console/core/src/util/date.ts
Normal file
9
packages/console/core/src/util/date.ts
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
export function getWeekBounds(date: Date) {
|
||||
const dayOfWeek = date.getUTCDay()
|
||||
const start = new Date(date)
|
||||
start.setUTCDate(date.getUTCDate() - dayOfWeek)
|
||||
start.setUTCHours(0, 0, 0, 0)
|
||||
const end = new Date(start)
|
||||
end.setUTCDate(start.getUTCDate() + 7)
|
||||
return { start, end }
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue