Skip to content

Commit

Permalink
Simplify doc tests and remove race condition
Browse files Browse the repository at this point in the history
  • Loading branch information
kipcole9 committed Jan 30, 2025
1 parent ec1b2ea commit 5df196f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
10 changes: 3 additions & 7 deletions lib/cldr/calendar.ex
Original file line number Diff line number Diff line change
Expand Up @@ -772,9 +772,7 @@ defmodule Cldr.Calendar do
Examples:
iex> {:ok, calendar} = Cldr.Calendar.calendar_from_locale("he")
iex> {:ok, date} = Date.new(2025, 1, 26, calendar)
iex> Cldr.Calendar.strftime(date, "%a", locale: :he)
iex> Cldr.Calendar.strftime(~D[2025-01-26 Cldr.Calendar.IL], "%a", locale: :he)
"יום א׳"
"""
Expand Down Expand Up @@ -818,10 +816,8 @@ defmodule Cldr.Calendar do
## Typical usage
iex> {:ok, calendar} = Cldr.Calendar.calendar_from_locale("he")
iex> {:ok, date} = Date.new(2025, 1, 26, calendar)
iex> Calendar.strftime date, "%a",
...> Cldr.Calendar.strftime_options!(calendar: calendar, locale: "en")
iex> Calendar.strftime(~D[2025-01-26 Cldr.Calendar.IL], "%a",
...> Cldr.Calendar.strftime_options!(calendar: Cldr.Calendar.IL, locale: "en"))
"Sun"
"""
Expand Down
6 changes: 2 additions & 4 deletions lib/cldr/calendar/backend/calendar.ex
Original file line number Diff line number Diff line change
Expand Up @@ -309,10 +309,8 @@ defmodule Cldr.Calendar.Backend do
## Typical usage
iex> {:ok, calendar} = Cldr.Calendar.calendar_from_locale("he")
iex> {:ok, date} = Date.new(2025, 1, 26, calendar)
iex> Calendar.strftime date, "%a",
...> MyApp.Cldr.Calendar.strftime_options!(calendar: calendar, locale: "en")
iex> Calendar.strftime ~D[2025-01-26 Cldr.Calendar.IL], "%a",
...> MyApp.Cldr.Calendar.strftime_options!(calendar: Cldr.Calendar.IL, locale: "en")
"Sun"
"""
Expand Down
5 changes: 5 additions & 0 deletions mix/territory/il.ex
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
require Cldr.Calendar.Compiler.Month

defmodule Cldr.Calendar.IL do
use Cldr.Calendar.Base.Month, day_of_week: 7
end

0 comments on commit 5df196f

Please sign in to comment.