Skip to content

Commit 621cef0

Browse files
committed
add datatime_to_iodata
1 parent 4f66340 commit 621cef0

File tree

1 file changed

+31
-1
lines changed

1 file changed

+31
-1
lines changed

lib/elixir/lib/calendar/iso.ex

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1443,6 +1443,37 @@ defmodule Calendar.ISO do
14431443
utc_offset,
14441444
std_offset,
14451445
format \\ :extended
1446+
) do
1447+
datetime_to_iodata(
1448+
year,
1449+
month,
1450+
day,
1451+
hour,
1452+
minute,
1453+
second,
1454+
microsecond,
1455+
time_zone,
1456+
zone_abbr,
1457+
utc_offset,
1458+
std_offset,
1459+
format
1460+
)
1461+
|> IO.iodata_to_binary()
1462+
end
1463+
1464+
def datetime_to_iodata(
1465+
year,
1466+
month,
1467+
day,
1468+
hour,
1469+
minute,
1470+
second,
1471+
microsecond,
1472+
time_zone,
1473+
zone_abbr,
1474+
utc_offset,
1475+
std_offset,
1476+
format \\ :extended
14461477
)
14471478
when is_time_zone(time_zone) and is_zone_abbr(zone_abbr) and is_utc_offset(utc_offset) and
14481479
is_std_offset(std_offset) do
@@ -1453,7 +1484,6 @@ defmodule Calendar.ISO do
14531484
offset_to_iodata(utc_offset, std_offset, time_zone, format),
14541485
zone_to_iodata(utc_offset, std_offset, zone_abbr, time_zone)
14551486
]
1456-
|> IO.iodata_to_binary()
14571487
end
14581488

14591489
@doc false

0 commit comments

Comments
 (0)