MCPcopy Create free account
hub / github.com/codemix/graph / week

Method week

packages/graph/src/TemporalTypes.ts:578–584  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

576 }
577
578 public get week(): number {
579 const date = new Date(Date.UTC(this.#year, this.#month - 1, this.#day));
580 const dayNum = date.getUTCDay() || 7;
581 date.setUTCDate(date.getUTCDate() + 4 - dayNum);
582 const yearStart = new Date(Date.UTC(date.getUTCFullYear(), 0, 1));
583 return Math.ceil(((date.getTime() - yearStart.getTime()) / 86400000 + 1) / 7);
584 }
585
586 public get dayOfWeek(): number {
587 const date = new Date(this.#year, this.#month - 1, this.#day);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected