Skip to content

Commit

Permalink
Update date.ex
Browse files Browse the repository at this point in the history
  • Loading branch information
josevalim committed May 11, 2024
1 parent 22e2cee commit 553a65e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/elixir/lib/calendar/date.ex
Original file line number Diff line number Diff line change
Expand Up @@ -1164,11 +1164,11 @@ defmodule Date do

def inspect(%{calendar: calendar, year: year, month: month, day: day}, _)
when calendar == Calendar.ISO do
"Date.new!(#{year}, #{month}, #{day})"
"Date.new!(#{Integer.to_string(year)}, #{Integer.to_string(month)}, #{Integer.to_string(day)})"
end

def inspect(%{calendar: calendar, year: year, month: month, day: day}, _) do
"Date.new!(#{year}, #{month}, #{day}, #{inspect(calendar)})"
"Date.new!(#{Integer.to_string(year)}, #{Integer.to_string(month)}, #{Integer.to_string(day)}, #{inspect(calendar)})"
end

defp suffix(Calendar.ISO), do: ""
Expand Down

0 comments on commit 553a65e

Please sign in to comment.