mirror of
https://github.com/iv-org/invidious.git
synced 2025-03-09 23:50:20 -04:00
replace time calculations with the stdlib's native functions
Co-authored-by: syeopite <70992037+syeopite@users.noreply.github.com>
This commit is contained in:
parent
a06166a014
commit
a9bc4fd978
@ -86,10 +86,16 @@ we're going to need to do it here in order to allow for translations.
|
|||||||
</a>
|
</a>
|
||||||
<% end %>
|
<% end %>
|
||||||
<span class="length-watch-page">
|
<span class="length-watch-page">
|
||||||
<% if (video.length_seconds // 60) < 60 %>
|
<% time_span_length = video.length_seconds.seconds %>
|
||||||
<%= video.length_seconds // 60 %> min
|
|
||||||
|
<% if time_span_length.days > 0 %>
|
||||||
|
<%= time_span_length.days %> d <%= time_span_length.hours %> hr <%= time_span_length.minutes %> min
|
||||||
|
<% elsif time_span_length.hours > 0 %>
|
||||||
|
<%= time_span_length.hours %> hr <%= time_span_length.minutes %> min
|
||||||
|
<% elsif time_span_length.minutes > 0 %>
|
||||||
|
<%= time_span_length.minutes %> min
|
||||||
<% else %>
|
<% else %>
|
||||||
<%= video.length_seconds // 3600 %> hr <%= (video.length_seconds % 3600) // 60 %> min
|
<%= time_span_length.seconds %> seconds
|
||||||
<% end %>
|
<% end %>
|
||||||
</span>
|
</span>
|
||||||
</h1>
|
</h1>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user