ocaml-toml / To.ml

OCaml library for TOML
https://ocaml-toml.github.io/To.ml
Other
82 stars 20 forks source link

Support dates without times #70

Closed alan-j-hu closed 3 years ago

alan-j-hu commented 3 years ago

The TOML spec supports the following datetime formats:

This PR adds support for the local date format. I am using this library to write a static site generator, and I want users to be able to specify dates without times for post dates.

Should support for the other date formats be added? The API might need to be changed (for example, changing TDate of float to TDate of float * float option to represent the time zone).

zapashcanon commented 3 years ago

Thanks for this !

For now, this library is following TOML v0.4.0 spec. In this version, it isn't supported.

I'd like to release toml 7.0.0 soon and thus, to stay on the v0.4.0 spec. On the other hand, this change is clearly backward compatible and we want to eventually update to a new version of the spec (see #60) so I'm OK with merging this.

Could you add a note in CHANGES.md ? Once it's done, I'm happy to merge !

Should support for the other date formats be added? The API might need to be changed (for example, changing TDate of float to TDate of float * float option to represent the time zone).

If you could do a PR, that would be very nice, but if it needs an API change, I won't merge it until the next release (which should happen in a few days).

alan-j-hu commented 3 years ago

Okay, I updated CHANGES.md.

zapashcanon commented 3 years ago

Thanks !