package melange-moment
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=0a3c7cf4159d7427bbad91e66b1cac373744f54c03dfb4f04a464f3f72bb3364
sha512=b657d199a0708e79d3b89d74c73b0a923792d901151379e6d2b4c9d25f7285b7893c73ce09bef3d56658a6b3e86c3b4edd5474a6c983462a05d55c41feb6319d
doc/README.html
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#mainThe 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.