I am looking forward to the discussion. The only constraint I propose is that the parsing of the basic format would have to be explicit (i.e. you would have to pass the :basic atom to the function).
*José Valim* www.plataformatec.com.br Skype: jv.ptec Founder and Director of R&D On Tue, Aug 6, 2019 at 11:50 AM Stefan Chrobot <[email protected]> wrote: > Hi! > > Date (and friends) can be formatted using either "basic" or "extended" > ISO8601, but parsing is only implemented for the "extended" format. > > So one can do: > > iex> Date.to_iso8601(~D[2019-07-01]) |> Date.from_iso8601() > {:ok, ~D[2019-07-01]} > > but this won't "work": > > iex> Date.to_iso8601(~D[2019-07-01], :basic) |> Date.from_iso8601() > {:error, :invalid_format} > > Is there any reason for that? Would you accept a PR that adds this feature? > > > > Best, > > Stefan > > -- > 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 [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/elixir-lang-core/172d294d-3a56-42e1-873f-deea0cc0880c%40googlegroups.com > <https://groups.google.com/d/msgid/elixir-lang-core/172d294d-3a56-42e1-873f-deea0cc0880c%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/CAGnRm4JAknC0ho52Xf9m8jwtFYOcdvYRXMfGs%3Dv2eL6FcZeWLw%40mail.gmail.com.
