🚀 DAY 5 OF LAUNCH WEEK: Introducing Socket Firewall Enterprise.Learn more →
Socket
Book a DemoInstallSign in
Socket

datepress

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

datepress

date helpers to range, group, aggregate collections

latest
Source
npmnpm
Version
0.0.9
Version published
Maintainers
1
Created
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

date

FAQs

Package last updated on 14 Nov 2019

Did you know?

Socket

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