This is a project with reason bindings for [date-fns v2](https://date-fns.org/v2.0.0/docs/Getting-Started). These bindings are using `FP` module of date-fns. So please refer the [FP documentation](https://date-fns.org/v2.0.0/docs/FP-Guide). In short all m

Usage no npm install needed!

<script type="module">
  import seamonsterStudiosReasonDateFns from 'https://cdn.skypack.dev/@seamonster-studios/reason-date-fns';


Reason bindings for date-fns v2

This is a project with ReasonML bindings for date-fns v2. These bindings are using FP module of date-fns. So please refer the FP documentation. In short: all methods are curried and date value is always last argument (|>).

Tip: On date-fns documentation you can choose submodule in the top right corner and view documentation and function signatures just like you would use it in reason. Here is an example of FP submodule docs page.

Date-fns docs site submodule toggle

Simple example:

open ReasonDateFns;

|> DateFns.addDays(2)
|> DateFns.addDays(-2)
|> DateFns.closestTo([|
|> DateFns.lightFormat("YYYY-MM-DD");

|> DateFns.formatWithOptions(
     DateFns.formatOptions(~locale=DateFns.Locales.ru, ()),

|> DateFns.addMinutes(10.)
|> DateFns.addSeconds(10.)
|> DateFns.addMilliseconds(1000)

Have a fun with FP 👨‍💻


Make sure that you need date-fns v2.

yarn add reason-date-fns

And add reason-date-fns to your bsconfig.json

  "bs-dependencies": [

Differences from bs-date-fns

There are 2:

  1. This project is exporting to date-fns of v2
  2. And using FP submodule. So currying is enabled by default 😎


This project is under the terms of MIT license