-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support Js.Date.t #24
Comments
I agree, it'd be nice to have some default. I've implemented multiple versions of my own Decco codecs for date, since sometimes I have to work with dates as ISO strings, and other times I work with them as number timestamps. But it would be nice to have Date available for Greenfield projects, and have it work with ISO strings by default. |
Interesting. I'm not sure yet about supporting Js.Date.t by default, for the reasons @mrmurphy mentioned, but it would make sense at least to add codecs that can be used with |
@ryb73 I think that's a good solution! |
hi @ryb73 I'd like to make a PR to add the codecs for Js.Date.t (one for ISO date string and one for timestamp), are there instructions on how to contribute?
|
great lib by the way :) |
Thanks! Not at my computer right now, I'll take a closer look later. What
OS are you using? It sounds like yarn build-ppx was successful but yarn
build was not?
…On Wed, Oct 23, 2019 at 7:57 PM tsnobip ***@***.***> wrote:
great lib by the way :)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#24>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAHGK5GFMHXKJOXFU5LQSFTQQDQHRANCNFSM4ITPCGXA>
.
|
Yes yarn build-ppx was successful unlike yarn build-lib. I'm using macOS Mojave. |
it's my first time building native, do I have to install opam, make a switch to 4.02 etc? |
No, opam shouldn't be needed as esy will handle the installation of ocaml. What if you try running something like this?
|
when I do that it prints :
|
Ok, so that's working. What if you define a type in that ml file with a
@@decco attribute? I'm trying to isolate the failure
I'm on the discord as rpbiwer if you're interested in continuing this
discussion in chat
…On Thu, Oct 24, 2019 at 4:40 PM tsnobip ***@***.***> wrote:
when I do that it displays :
let _ = 1
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#24>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAHGK5HSPWPMWBRCOI6S6W3QQIB3TANCNFSM4ITPCGXA>
.
|
OK I found the issue, it was just an end of line issue in |
Hey @ryb73!
First of all thanks for this wonderful ppx, it helped to get rid of quite some boilerplate code.
What would be really helpful if ppx_decode shipped with Js.Date.t decoder, even though JSON has no support for dates. Something like https://mlms13.github.io/bs-decode/docs/decoding-simple-values does, some sort of best effort
new Date
call on the string that is supposed to be a date.Thanks,
Josef
The text was updated successfully, but these errors were encountered: