Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

date-interval

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

date-interval

Calculate dates inside an interval

latest
Source
npmnpm
Version
0.0.1
Version published
Maintainers
1
Created
Source

date-interval

Get an array of dates between a start date and an end date, using a date-math granularity.

Quickstart

var Dates = require('date-math');
var interval = require('date-interval');

var start = new Date('2013-10-8T03:45:00Z');
var end = new Date('2013-10-11T04:25:00Z');

interval(Dates.day, start, end, { floor: true });
/*
[
  new Date('2013-10-08T00:00:00.000Z'),
  new Date('2013-10-09T00:00:00.000Z'),
  new Date('2013-10-10T00:00:00.000Z'),
  new Date('2013-10-11T00:00:00.000Z')
]
*/

API

interval(granularity, start, end, options)

Get an array of dates between a start date and an end date with a specific date-math granularity.

License

MIT

Keywords

date

FAQs

Package last updated on 22 Nov 2013

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