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

Method week

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

Source from the content-addressed store, hash-verified

835 }
836
837 public get week(): number {
838 const date = new Date(Date.UTC(this.#year, this.#month - 1, this.#day));
839 const dayNum = date.getUTCDay() || 7;
840 date.setUTCDate(date.getUTCDate() + 4 - dayNum);
841 const yearStart = new Date(Date.UTC(date.getUTCFullYear(), 0, 1));
842 return Math.ceil(((date.getTime() - yearStart.getTime()) / 86400000 + 1) / 7);
843 }
844
845 public get dayOfWeek(): number {
846 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