erlsci / iso8601

An ISO 8601 date formating and parsing library for Erlang
MIT License
130 stars 93 forks source link

Fix iso8601:format/1 spec #41

Closed amilkr closed 7 years ago

amilkr commented 7 years ago

The spec allows calendar:datetime() | timestamp() but it's not enough since the second function clause allows S to be float()

https://github.com/erlsci/iso8601/blob/master/src/iso8601.erl#L32

format({{Y,Mo,D}, {H,Mn,S}}) when is_float(S) ->

And that's not valid for the calendar:datetime() type (where second() = 0..59)