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

Function addDaysToYmd

common/src/util/zoned-time.ts:35–48  ·  view source on GitHub ↗
(
  year: number,
  month: number,
  day: number,
  days: number,
)

Source from the content-addressed store, hash-verified

33}
34
35export function addDaysToYmd(
36 year: number,
37 month: number,
38 day: number,
39 days: number,
40): Pick<ZonedDateParts, 'year' | 'month' | 'day'> {
41 const next = new Date(Date.UTC(year, month - 1, day))
42 next.setUTCDate(next.getUTCDate() + days)
43 return {
44 year: next.getUTCFullYear(),
45 month: next.getUTCMonth() + 1,
46 day: next.getUTCDate(),
47 }
48}
49
50export function getUtcForZonedTime(
51 parts: Pick<ZonedDateParts, 'year' | 'month' | 'day'>,

Callers 2

getZonedDayBoundsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected