Skip to content

elasticio/jsonata-moment

Repository files navigation

jsonata-moment

NPM statistics

Build Status

Moment.js support for JSONata.

How to install

npm install @elastic.io/jsonata-moment

Usage

$moment function provides the same functionality, as regular moment() does.

In node.js

const jsonataMoment = require('@elastic.io/jsonata-moment');
const result = jsonataMoment('$moment().format("YYYY-MM-DD")').evaluate();

In browser

There is a regular as well as minified versions of the library in a dist folder.

const result = window.jsonataMoment('$moment().format("YYYY-MM-DD")').evaluate();