package melange-moment

  1. Overview
  2. Docs
Melange bindings for Moment.js

Install

Dune Dependency

Authors

Maintainers

Sources

melange-moment-0.3.0.tbz
sha256=0a3c7cf4159d7427bbad91e66b1cac373744f54c03dfb4f04a464f3f72bb3364
sha512=b657d199a0708e79d3b89d74c73b0a923792d901151379e6d2b4c9d25f7285b7893c73ce09bef3d56658a6b3e86c3b4edd5474a6c983462a05d55c41feb6319d

Description

Tags

melange org:ahrefs

Published: 24 Oct 2023

README

melange-moment

Melange bindings for Moment.js.

Based on bs-moment.

Status

This package is still 🚧 WIP 🚧, but new bindings are added as needed instead of actively. Feel free to create an issue or PR if you find anything missing.

Installation

Install opam package manager.

Then:

opam pin add melange-moment.dev git+https://github.com/ahrefs/melange-moment.git#main

The bindings support the following versions of the moment npm package, which should be installed separately:

  "dependencies": {
    "moment": "^2.26.0"
  }

Setup

Add melange-moment to the libraries field in your dune file:

; ...
  (libraries melange-moment)
; ...

Mutations

This binding takes an opinionated approach to mutations, e.g. moment().add, moment().startOf, and bind them with names like mutableAdd and mutableStartOf. To compensate that, there's an immutable version named add and startOf which takes a moment().clone first before applying the mutations.

Deprecations

Deprecated methods (e.g. moment().days in favor of moment().day) are not included in this binding.

Dependencies (4)

  1. reason
  2. melange >= "2.0.0"
  3. ocaml
  4. dune >= "3.9"

Dev Dependencies (3)

  1. odoc with-doc
  2. opam-check-npm-deps with-test
  3. melange-jest with-test

Conflicts

None

OCaml

Innovation. Community. Security.