This repository contains in-progress Reason/Bucklescript bindings for Luxon.
This is an example from Luxon's GitHub page written in Reason using bs-luxon:
const { DateTime } = require("luxon");
DateTime.local().setZone('America/New_York').minus({ weeks: 1 }).endOf('day').toISO()
DateTime.(
local()
|> setZone("America/New_York")
|> minus(`Duration(Duration.from(~weeks=1, ())))
|> endOf(`day)
|> toISO()
);
Look in the example/
directory for an example of how to use the bindings. The tests contain a lot more examples.
npm install --save bs-luxon
bsconfig.json
:{
"bs-dependencies": [
"bs-luxon"
]
}
npm run build
npm run start
The API is still very complete and the bindings are not very "OCamly" yet. Use at your own risk.