reason-luxon

0.6.0 • Public • Published

reason-luxon

BuckleScript bindings to Luxon

Installation

npm install reason-luxon luxon --save

Then add reason-luxon to bs-dependencies in bsconfig.json

{  
  "bs-dependencies": [    
    "reason-luxon"
  ],
}

Usage

open Luxon

let start = DateTime.(
  local()
  ->setZone(Zone.IANA.create("America/New_York"))
  ->minus(Duration.make(~weeks=1., ()))
  ->endOf(`day)  
);

let end_ = start->DateTime.plus(Duration.make(~weeks=1.0, ()))

Interval.fromDateTimes(start, end_)
->Interval.toString

Documentation

Each .rei file contains a link to the relevant Luxon documentation:

Contributing / Status

The following Luxon APIs are not complete, either due to the Luxons docs being a little lacking, the binding being a little tricky or the current binding is missing some options which the Luxon API would accept.

Pull requests are very much appreciated:

Package Sidebar

Install

npm i reason-luxon

Weekly Downloads

1

Version

0.6.0

License

MIT

Unpacked Size

60.7 kB

Total Files

28

Last publish

Collaborators

  • dean177