Fix display_time
All checks were successful
CI / scan_ruby (push) Successful in 15s
CI / scan_js (push) Successful in 12s
CI / lint (push) Successful in 11s
CI / test (push) Successful in 26s

This commit is contained in:
sto 2025-06-21 10:54:20 +02:00
parent 4b5c09f63b
commit 2969a24cb0
2 changed files with 10 additions and 9 deletions

View File

@ -8,15 +8,16 @@ module CompletionsConcern
"0" + n.to_s
end
def display_time(seconds)
if seconds > 3600
hours = seconds / 3600
return hours.to_s + ":" + display_time(seconds % 3600)
elsif seconds > 60
minutes = seconds / 60
return pad(minutes) + ":" + display_time(seconds % 60)
def display_time(time)
h = time / 3600
m = (time % 3600) / 60
s = (time % 3600) % 60
if h > 0
return h.to_s + ":" + pad(m) + ":" + pad(s)
elsif m > 0
return m.to_s + ":" + pad(s)
end
pad(seconds)
s.to_s
end
def extend_completions!(contestant)

View File

@ -28,7 +28,7 @@ javascript:
</svg>
=< t("contests.show.copy_extension_url")
.row.mb-4 style="height: calc(100vh - 320px)"
.row.mb-4 style="height: calc(100vh - 280px)"
.col-7.d-flex.flex-column style="height: 100%"
.row
.col