Skip to content

Commit 6810c20

Browse files
committed
Assert the ISO calendar in DateTime.to_unix/2
1 parent 1fc0481 commit 6810c20

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/elixir/lib/calendar.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1075,7 +1075,7 @@ defmodule DateTime do
10751075
10761076
"""
10771077
@spec to_unix(DateTime.t, System.time_unit) :: non_neg_integer
1078-
def to_unix(%DateTime{std_offset: std_offset, utc_offset: utc_offset,
1078+
def to_unix(%DateTime{calendar: Calendar.ISO, std_offset: std_offset, utc_offset: utc_offset,
10791079
hour: hour, minute: minute, second: second, microsecond: {microsecond, _},
10801080
year: year, month: month, day: day}, unit \\ :seconds) when year >= 1970 do
10811081
seconds =

0 commit comments

Comments
 (0)