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

Method toString

packages/graph/src/TemporalTypes.ts:290–303  ·  view source on GitHub ↗

* Convert to ISO string (HH:MM:SS.nnnnnnnnn).

()

Source from the content-addressed store, hash-verified

288 * Convert to ISO string (HH:MM:SS.nnnnnnnnn).
289 */
290 public toString(): string {
291 const h = String(this.#hour).padStart(2, "0");
292 const m = String(this.#minute).padStart(2, "0");
293 const s = String(this.#second).padStart(2, "0");
294
295 if (this.#nanosecond === 0) {
296 return `${h}:${m}:${s}`;
297 }
298
299 // Format nanoseconds, removing trailing zeros
300 let nanos = String(this.#nanosecond).padStart(9, "0");
301 nanos = nanos.replace(/0+$/, "");
302 return `${h}:${m}:${s}.${nanos}`;
303 }
304
305 public compareTo(other: LocalTimeValue): number {
306 if (this.#hour !== other.#hour) return this.#hour - other.#hour;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected