MCPcopy
hub / github.com/CodebuffAI/codebuff / getZonedDayBounds

Function getZonedDayBounds

common/src/util/zoned-time.ts:82–98  ·  view source on GitHub ↗
(
  now: Date,
  timeZone: string,
)

Source from the content-addressed store, hash-verified

80}
81
82export function getZonedDayBounds(
83 now: Date,
84 timeZone: string,
85): { startsAt: Date; resetsAt: Date } {
86 const nowParts = getZonedParts(now, timeZone)
87 const today = {
88 year: nowParts.year,
89 month: nowParts.month,
90 day: nowParts.day,
91 }
92 const tomorrow = addDaysToYmd(today.year, today.month, today.day, 1)
93
94 return {
95 startsAt: getUtcForZonedTime(today, timeZone, 0, 0),
96 resetsAt: getUtcForZonedTime(tomorrow, timeZone, 0, 0),
97 }
98}

Callers 3

zoned-time.test.tsFile · 0.90

Calls 3

getZonedPartsFunction · 0.85
addDaysToYmdFunction · 0.85
getUtcForZonedTimeFunction · 0.85

Tested by

no test coverage detected