massivefermion / birl

datetime handling for gleam
https://hex.pm/packages/birl
Apache License 2.0
72 stars 9 forks source link

Why `from_erlang_datetime` functions only target Erlang? #35

Open ghivert opened 3 months ago

ghivert commented 3 months ago

Hi!

The question is in the title. :) Why from_erlang_universal_datetime does not target JS, while it is coded in pure Gleam? I mean, OK, the format is somewhat Erlang specific, but we're only talking about a structure having the Erlang Datetime data structure. Nothing stops you to use it in JS. 🙂 This also leads to some frustration when you want to code a unique decoder for your data structure, and use it everywhere, from Erlang to JS. 🙂

Thanks!

massivefermion commented 3 months ago

Hi Yeah, that makes sense actually! Sometimes I just do weird things like that! :) I'll fix it as soon as I can, but maybe it could use a better name! thanks for the issue