Skip to content

Luxon bindings for Bucklescript/ReasonML

License

Notifications You must be signed in to change notification settings

rikimasan/bs-luxon

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Luxon Bindings for ReasonML/Bucklescript

This repository contains in-progress Reason/Bucklescript bindings for Luxon.

Example

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()
open BsLuxon;

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.

Installation

  1. Install the bindings using npm install --save bs-luxon
  2. Add the bindings to bsconfig.json:
{
  "bs-dependencies": [
      "bs-luxon"
  ]
}

Build

npm run build

Build + Watch

npm run start

Current State & Todo

The API is still very complete and the bindings are not very "OCamly" yet. Use at your own risk.

About

Luxon bindings for Bucklescript/ReasonML

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Reason 89.6%
  • Makefile 10.4%