* Convert to ISO string (HH:MM:SS.nnnnnnnnn).
()
| 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; |
nothing calls this directly
no outgoing calls
no test coverage detected