Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ahrefs/melange-moment
Melange bindings for Moment.js
https://github.com/ahrefs/melange-moment
Last synced: 18 days ago
JSON representation
Melange bindings for Moment.js
- Host: GitHub
- URL: https://github.com/ahrefs/melange-moment
- Owner: ahrefs
- License: mit
- Created: 2023-06-22T15:34:03.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-10-25T17:06:21.000Z (3 months ago)
- Last Synced: 2024-12-16T19:17:40.963Z (24 days ago)
- Language: Reason
- Size: 790 KB
- Stars: 0
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGES.md
- License: LICENSE
Awesome Lists containing this project
README
# melange-moment
[Melange](https://melange.re) bindings for [Moment.js](https://momentjs.com/).
Based on [bs-moment](https://github.com/Jimexist/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](https://opam.ocaml.org/) package manager.
Then:
```bash
opam install melange-moment
```The bindings support the following versions of the `moment`
npm package, which should be installed separately:```json
"dependencies": {
"moment": "^2.26.0"
}
```## Setup
Add `melange-moment` to the `libraries` field in your `dune` file:
```clojure
; ...
(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.