Skip to content

Commit

Permalink
Add test for date filter using %s
Browse files Browse the repository at this point in the history
  • Loading branch information
edgurgel committed Jul 10, 2024
1 parent 09d3ecc commit f34e0e6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/solid/filter.ex
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,11 @@ defmodule Solid.Filter do
The format for this syntax is the same as `Calendar.strftime/2`.
To get the current time, pass the special word `"now"` (or `"today"`) to `date`.
iex> Solid.Filter.date("1970-01-01 00:00:00Z", "%s")
"0"
iex> Solid.Filter.date("1970-01-01 00:00:01Z", "%s")
"1"
"""
@spec date(DateTime.t() | NaiveDateTime.t() | integer() | String.t(), String.t()) :: String.t()
def date(date, format) when is_map(date) and is_binary(format) do
Expand Down

0 comments on commit f34e0e6

Please sign in to comment.