9 lines
241 B
Elixir
9 lines
241 B
Elixir
defmodule PodcastFeedWeb.FeedView do
|
|
use PodcastFeedWeb, :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
|