Skip to content

Commit

Permalink
Remove nimble_strftime from deps (use Calendar.strftime/3 instead)
Browse files Browse the repository at this point in the history
  • Loading branch information
kipcole9 committed Jun 21, 2024
1 parent c1d9f88 commit 59b34f9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
1 change: 0 additions & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ defmodule Cldr.Calendar.MixProject do
{:ex_doc, "~> 0.21", optional: true, runtime: false},
{:benchee, "~> 1.0", optional: true, only: [:dev, :test]},
{:dialyxir, "~> 1.0", optional: true, only: [:dev, :test], runtime: false},
{:nimble_strftime, "~> 0.1", only: :test},
{:stream_data, "~> 1.0", only: :test}
]
end
Expand Down
14 changes: 7 additions & 7 deletions test/strftime_options_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -50,28 +50,28 @@ defmodule Cldr.Calendar.StrftimeOptions.Test do
end

test "strftime with options" do
assert NimbleStrftime.format(
assert Calendar.strftime(
~D[2019-11-03],
"%a, %B %d %Y",
MyApp.Cldr.Calendar.strftime_options!()
) ==
"Sun, November 03 2019"

assert NimbleStrftime.format(
assert Calendar.strftime(
~D[2019-11-03],
"%A, %b %d %Y",
MyApp.Cldr.Calendar.strftime_options!()
) ==
"Sunday, Nov 03 2019"

assert NimbleStrftime.format(
assert Calendar.strftime(
~D[2019-11-03],
"%A, %b %d %Y",
MyApp.Cldr.Calendar.strftime_options!("fr")
) ==
"dimanche, nov. 03 2019"

assert NimbleStrftime.format(
assert Calendar.strftime(
~D[2019-11-03],
"%A, %B %d %Y",
MyApp.Cldr.Calendar.strftime_options!("he")
Expand All @@ -80,22 +80,22 @@ defmodule Cldr.Calendar.StrftimeOptions.Test do

{:ok, dt} = NaiveDateTime.new(2019, 8, 26, 13, 52, 06, 0)

assert NimbleStrftime.format(
assert Calendar.strftime(
dt,
"%y-%m-%d %I:%M:%S %p",
MyApp.Cldr.Calendar.strftime_options!("fr")
) ==
"19-08-26 01:52:06 PM"

assert NimbleStrftime.format(
assert Calendar.strftime(
dt,
"%y-%m-%d %I:%M:%S %p",
MyApp.Cldr.Calendar.strftime_options!("he")
) ==
"19-08-26 01:52:06 אחה״צ"

assert_raise Cldr.InvalidLanguageError, fn ->
NimbleStrftime.format(
Calendar.strftime(
dt,
"%y-%m-%d %I:%M:%S %p",
MyApp.Cldr.Calendar.strftime_options!("zz")
Expand Down

0 comments on commit 59b34f9

Please sign in to comment.