open-pod/lib/openpod_web/views/feed_view.ex
2020-06-08 21:37:11 +00:00

9 lines
233 B
Elixir

defmodule OpenpodWeb.FeedView do
use OpenpodWeb, :view
def format_length(length) do
min = length / 60 |> trunc()
sec = length - (min * 60) |> Integer.to_string |> String.pad_leading(2, "0")
"#{min}:#{sec}"
end
end