0.6.0 • Published 4 years ago

reason-luxon v0.6.0

Weekly downloads
3
License
MIT
Repository
github
Last release
4 years ago

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: