Socket
Socket
Sign inDemoInstall

date-diff

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

date-diff - npm Package Compare versions

Comparing version 0.1.3 to 0.2.0

.nvmrc

15

date-diff.js

@@ -1,10 +0,9 @@

/*
* DateDiff
* is a minimalized Javascript date arithmetic extension.
* Copyright (c) 2015 Melvin Sembrano (melvinsembrano@gmail.com)
* License: MIT
*/
// Generated by CoffeeScript 2.3.0
(function() {
/*
* DateDiff
* is a minimalized Javascript date arithmetic extension.
* Copyright (c) 2015 Melvin Sembrano (melvinsembrano@gmail.com)
* License: MIT
*/
var DateDiff, divisors;

@@ -11,0 +10,0 @@

@@ -5,3 +5,3 @@ {

"description": "DateDiff is a minimalized Javascript date arithmetic extension.",
"version": "0.1.3",
"version": "0.2.0",
"keywords": [

@@ -22,20 +22,23 @@ "DateDiff",

"devDependencies": {
"coffeescript": "^2.2.3",
"easy-date": "^1.0.0",
"grunt": "^0.4.5",
"grunt-bump": "^0.6.0",
"grunt-contrib-coffee": "^0.13.0",
"grunt-contrib-jasmine": "^0.9.2",
"grunt-contrib-uglify": "^0.11.0",
"grunt-contrib-watch": "^0.6.1",
"grunt-exec": "^0.4.6",
"grunt-karma": "^0.12.1",
"jasmine": "^2.4.1",
"jasmine-core": "^2.4.0",
"karma": "^0.13.15",
"karma-jasmine": "^0.3.6",
"karma-phantomjs-launcher": "^0.2.1"
"grunt": "^1.0.2",
"grunt-bump": "^0.8.0",
"grunt-contrib-coffee": "^2.0.0",
"grunt-contrib-jasmine": "^1.1.0",
"grunt-contrib-uglify": "^3.3.0",
"grunt-contrib-watch": "^1.0.0",
"grunt-exec": "^3.0.0",
"grunt-karma": "^2.0.0",
"jasmine": "^3.1.0",
"jasmine-core": "^3.1.0",
"karma": "^2.0.0",
"karma-jasmine": "^1.1.1",
"karma-phantomjs-launcher": "^1.0.4"
},
"scripts": {
"test": "./node_modules/karma/bin/karma start --single-run --browsers PhantomJS"
"test": "./node_modules/karma/bin/karma start --single-run --browsers PhantomJS",
"compile": "coffee --compile --output . src/",
"build": "npm run compile && grunt"
}
}
[![Build Status](https://travis-ci.org/melvinsembrano/date-diff.svg)](https://travis-ci.org/melvinsembrano/date-diff)
[![npm version](https://badge.fury.io/js/date-diff.svg)](https://badge.fury.io/js/date-diff)
# DateDiff
DateDiff is a minimalized javascript date arithmetic extension
DateDiff is a minimalized javascript date arithmetic extension.
It works perfectly with [**easy-date**](https://github.com/melvinsembrano/easy-date)
### Installation

@@ -37,3 +40,3 @@ **Node.js** `npm install date-diff`

```
it also add a date helper:
it also add a date helper method:
```

@@ -40,0 +43,0 @@ Date.diff(date1, date2).years();

@@ -46,11 +46,8 @@ describe('DateDiff', function() {

});
it('will return 16', function() {
expect(Date.diff(Date.today(), 16..hour().ago()).hours()).toBe(16);
});
it('will return 24', function() {
expect(Date.diff(Date.today(), 1..day().ago()).hours()).toBe(24);
expect(Date.diff(new Date(2018, 3, 12), new Date(2018, 3, 11)).hours()).toBe(24);
});
it('will return 72', function() {
expect(Date.diff(Date.today(), 3..days().ago()).hours()).toBe(72);
expect(Date.diff(new Date(2018, 3, 12), new Date(2018, 3, 9)).hours()).toBe(72);
});

@@ -67,3 +64,3 @@ });

it('will return 4320', function() {
expect(Date.diff(Date.today(), 3..days().ago()).minutes()).toBe(4320);
expect(Date.diff(new Date(2018, 3, 12), new Date(2018, 3, 11)).seconds()).toBe(86400);
});

@@ -77,3 +74,3 @@ });

it('will return 86400', function() {
expect(Date.diff(Date.today(), 1..day().ago()).seconds()).toBe(86400);
expect(Date.diff(new Date(2018, 3, 12), new Date(2018, 3, 11)).seconds()).toBe(86400);
});

@@ -80,0 +77,0 @@ });

Sorry, the diff of this file is not supported yet

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