We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 44ea7a6 commit 4e61690Copy full SHA for 4e61690
1 file changed
lib/elixir/lib/calendar/iso.ex
@@ -1176,7 +1176,7 @@ defmodule Calendar.ISO do
1176
@doc since: "1.8.0"
1177
@spec year_of_era(year) :: {1..10_000, era}
1178
def year_of_era(year) when is_year_CE(year), do: {year, 1}
1179
- def year_of_era(year) when is_year_BCE(year), do: {abs(year) + 1, 0}
+ def year_of_era(year) when is_year_BCE(year), do: {1 - year, 0}
1180
1181
@doc """
1182
Calendar callback to compute the year and era from the
@@ -1229,7 +1229,7 @@ defmodule Calendar.ISO do
1229
end
1230
1231
def day_of_era(year, month, day) when is_year_BCE(year) do
1232
- day = abs(date_to_iso_days(year, month, day) - @iso_epoch)
+ day = @iso_epoch - date_to_iso_days(year, month, day)
1233
{day, 0}
1234
1235
0 commit comments