Nationwide Polyamorous Matrimony

npm

Ready to take your JavaScript development to the next level? Meet npm Enterprise - the ultimate in enterprise JavaScript.Learn more »

moment-to-reql

1.1.1 • Public • Published

moment-to-reql

GratiPay Downloads Version

A helper function to convert moment.js object to ReQL so that Timezone information can be preserved when passing data to RethinkDB.

Installation

moment-to-reql expects that you have already installed moment and moment-timezone.

npm instal --save-dev moment-to-reql

Usage

Returned value can be used in place of regular Date, r.now() and all other time/date objects in your ReQL queries:

import momentToReQL from 'moment-to-reql';
 
momentToReQL(moment.tz('10/10/2010 10:00', 'DD/MM/YYYY hh:mm', 'America/Los_Angeles');
// returns:
//  {
//    $reql_type$: 'TIME',
//    epoch_time: 1286730000,
//    timezone: '-07:00',
//  }

License

ISC

install

npm i moment-to-reql

Downloadsweekly downloads

3

version

1.1.1

license

ISC

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability