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

Method compareTo

packages/graph/src/TemporalTypes.ts:176–180  ·  view source on GitHub ↗

* Compare two dates for sorting. * Returns negative if this < other, positive if this > other, 0 if equal.

(other: DateValue)

Source from the content-addressed store, hash-verified

174 * Returns negative if this < other, positive if this > other, 0 if equal.
175 */
176 public compareTo(other: DateValue): number {
177 if (this.#year !== other.#year) return this.#year - other.#year;
178 if (this.#month !== other.#month) return this.#month - other.#month;
179 return this.#day - other.#day;
180 }
181}
182
183/**

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected