Socket
Socket
Sign inDemoInstall

datepress

Package Overview
Dependencies
2
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    datepress

date helpers to range, group, aggregate collections


Version published
Maintainers
1
Install size
5.39 MB
Created

Readme

Source

datepress

date helpers to range, group, aggregate collections

Installation

Using npm:

npm install datepress

In Node.js:

const DP = require('datepress');

Range example

const moment = require('moment');

let start = new Date();
let end = moment(start).add(10, 'days').toDate();
let delimiter = 'days';
let dates = DP.range(start, end, delimiter);
console.log(dates);

groupBy example

console.log(DP.groupBy(dates, 'days'));

findIndex example

DP.findIndex(collection, date, access);

access is function used to get the date from a item of the collection. If not provided it defaults to identity function.

slice example

DP.slice(collection, start, end, access);

batch example

DP.batch(collection, delimiter, access);

Returns batches from collection by provided delimiter. A delimiter parameter can be input known from moment.js like 'days', 'minutes',...

License

MIT © Andre Stehle

Keywords

FAQs

Last updated on 14 Nov 2019

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc