(timestamp?: Timestamp)
| 61 | }; |
| 62 | |
| 63 | export const formatTime = (timestamp?: Timestamp): string => { |
| 64 | if (!timestamp) return "--:--:--.---"; |
| 65 | const date = new Date(getTimestampMs(timestamp)); |
| 66 | return ( |
| 67 | [ |
| 68 | date.getHours().toString().padStart(2, "0"), |
| 69 | date.getMinutes().toString().padStart(2, "0"), |
| 70 | date.getSeconds().toString().padStart(2, "0"), |
| 71 | ].join(":") + |
| 72 | "." + |
| 73 | date.getMilliseconds().toString().padStart(3, "0") |
| 74 | ); |
| 75 | }; |
| 76 | |
| 77 | export const formatDuration = (ms: number): string => { |
| 78 | if (ms < 1) return "<1ms"; |
no test coverage detected