Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

instadate

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

instadate - npm Package Compare versions

Comparing version 0.1.4 to 0.1.5

9

instadate.js

@@ -115,5 +115,10 @@ var difference = require('lodash.difference');

dates: function(start, end) {
if (start > end) {
var temp = end;
end = start;
start = temp;
}
var result = []
, diff = instadate.differenceInDays(start, end);
for (var i = 0; i < diff; i++) {
, diff = instadate.differenceInDates(start, end);
for (var i = 0; i <= diff; i++) {
result.push(instadate.addDays(start, i));

@@ -120,0 +125,0 @@ }

{
"name": "instadate",
"version": "0.1.4",
"version": "0.1.5",
"description": "",

@@ -5,0 +5,0 @@ "main": "instadate.js",

@@ -160,9 +160,21 @@ var test = require('tape');

test('dates array', function (t) {
test('dates', function (t) {
var start = new Date('Mon Jan 18 2016 13:07:17 GMT+0200 (EET)')
, end = instadate.noon(new Date('Thu Jan 21 2016 13:07:17 GMT+0200 (EET)'));
var dates = instadate.dates(start, end);
t.equal(dates.length, 2);
t.equal(dates.length, 4);
t.ok(instadate.equal(dates[0], start));
t.equal(dates[1].toString(), instadate.addDays(start, 1).toString());
t.equal(dates[2].toString(), instadate.addDays(start, 2).toString());
t.equal(dates[3].toString(), instadate.addDays(start, 3).toString());
var start = instadate.noon(new Date('Thu Jan 21 2016 13:07:17 GMT+0200 (EET)'))
, end = new Date('Mon Jan 18 2016 13:07:17 GMT+0200 (EET)');
var dates = instadate.dates(start, end);
t.equal(dates.length, 4);
t.ok(instadate.equal(dates[0], end));
t.equal(dates[1].toString(), instadate.addDays(end, 1).toString());
t.equal(dates[2].toString(), instadate.addDays(end, 2).toString());
t.equal(dates[3].toString(), instadate.addDays(end, 3).toString());
t.end();

@@ -169,0 +181,0 @@ });

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc