I can't see a reason why not to add this. I think a PR would be welcome! Andrea Leopardi an.leopa...@gmail.com
On Mon, Jun 17, 2019 at 4:31 PM Mário Guimarães < mario.luis.guimar...@gmail.com> wrote: > The proposed function could be implemented like this > > def from_iso8601!(string, calendar \\ Calendar.ISO) do > case DateTime.from_iso8601(string, calendar) do > {:ok, datetime, offset} -> > {datetime, offset} > > {:error, reason} -> > raise ArgumentError, > "cannot convert #{string} to datetime, reason: > #{inspect(reason)}" > end > end > > > > segunda-feira, 17 de Junho de 2019 às 15:18:29 UTC+1, Mário Guimarães > escreveu: >> >> Hello, >> >> all "from_x" functions in DateTime support their throw exception version, >> but the function "from_iso8601/2" which returns an error tuple. >> >> Doesn't it make sense, because of convenience and completeness, to >> provide a bang version of this function? >> >> See https://hexdocs.pm/elixir/DateTime.html#from_iso8601/2 >> >> Thanks >> Mário >> > -- > You received this message because you are subscribed to the Google Groups > "elixir-lang-core" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to elixir-lang-core+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/elixir-lang-core/1b2ea98e-24b0-4829-8943-82ca3add955c%40googlegroups.com > <https://groups.google.com/d/msgid/elixir-lang-core/1b2ea98e-24b0-4829-8943-82ca3add955c%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "elixir-lang-core" group. To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-core+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/CAM9Rf%2BKbW4-RVUmVwJRioHnwwZ0C4utxBTUBwG%3Drs8_HtQySPQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.