diff options
| author | Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> | 2025-10-26 13:55:43 +0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-10-26 12:55:43 +0300 |
| commit | 7e9f8d5bcb22b813e0f647c97b06c88651c714a4 (patch) | |
| tree | a2405b4b60196163ddbfe621f0ae7d2f85430c6a /frontend | |
| parent | chore/frontend: semicolon linting (#287) (diff) | |
| download | lphub-7e9f8d5bcb22b813e0f647c97b06c88651c714a4.tar.gz lphub-7e9f8d5bcb22b813e0f647c97b06c88651c714a4.tar.bz2 lphub-7e9f8d5bcb22b813e0f647c97b06c88651c714a4.zip | |
fix/frontend: ticks_to_time (#288)
Diffstat (limited to 'frontend')
| -rw-r--r-- | frontend/src/utils/Time.ts | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/frontend/src/utils/Time.ts b/frontend/src/utils/Time.ts index 5e3d99b..509e627 100644 --- a/frontend/src/utils/Time.ts +++ b/frontend/src/utils/Time.ts | |||
| @@ -38,5 +38,11 @@ export function ticks_to_time(ticks: number) { | |||
| 38 | seconds = seconds % 60; | 38 | seconds = seconds % 60; |
| 39 | minutes = minutes % 60; | 39 | minutes = minutes % 60; |
| 40 | 40 | ||
| 41 | return `${hours === 0 ? "" : hours + ":"}${minutes === 0 ? "" : hours > 0 ? minutes.toString().padStart(2, "0") + ":" : (minutes + ":")}${minutes > 0 ? seconds.toString().padStart(2, "0") : seconds}.${milliseconds.toString().padStart(3, "0")}`; | 41 | if (hours > 0) { |
| 42 | return `${hours}:${minutes.toString().padStart(2, "0")}:${seconds.toString().padStart(2, "0")}.${milliseconds.toString().padStart(3, "0")}`; | ||
| 43 | } else if (minutes > 0) { | ||
| 44 | return `${minutes}:${seconds.toString().padStart(2, "0")}.${milliseconds.toString().padStart(3, "0")}`; | ||
| 45 | } else { | ||
| 46 | return `${seconds}.${milliseconds.toString().padStart(3, "0")}`; | ||
| 47 | } | ||
| 42 | }; \ No newline at end of file | 48 | }; \ No newline at end of file |