Skip to content

Commit 00e07f0

Browse files
committed
add duration to Phoenix.HTML.Safe
1 parent c11a9e3 commit 00e07f0

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

lib/phoenix_html/safe.ex

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ defimpl Phoenix.HTML.Safe, for: DateTime do
4444
end
4545
end
4646

47+
defimpl Phoenix.HTML.Safe, for: Duration do
48+
defdelegate to_iodata(data), to: Duration, as: :to_iso8601
49+
end
50+
4751
defimpl Phoenix.HTML.Safe, for: List do
4852
def to_iodata(list), do: recur(list)
4953

0 commit comments

Comments
 (0)