open-pod/lib/openpod_web/views/feed_view.ex

10 lines
233 B
Elixir
Raw Normal View History

2020-06-08 23:37:11 +02:00
defmodule OpenpodWeb.FeedView do
use OpenpodWeb, :view
2020-05-22 22:04:15 +02:00
def format_length(length) do
2020-05-24 23:01:58 +02:00
min = length / 60 |> trunc()
2020-05-24 23:13:17 +02:00
sec = length - (min * 60) |> Integer.to_string |> String.pad_leading(2, "0")
2020-05-22 22:04:15 +02:00
"#{min}:#{sec}"
end
end