🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

date-text-diff

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-text-diff

Compute the difference between the two dates in days

1.0.0
latest
Source
npm
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

DateDiff

Compute the difference between the two dates in days

How to run?

npm install
npm start       # run unit tests with coverage (output: ./coverage/lcov-report/index.html)

Run in JavaScript

var datediff = require("../index");
datediff("01 01 1990", "01 01 1990");     // 0
datediff("01 01 1990", "01 03 2017");     // 9921
datediff("01 01 1990", "01 03 9999");     // 2925286
datediff("29 02 1990", "01 03 9999");     // generate error

Run in CLI

node datediff-cli "01 01 1990" "01 01 1990"     # 0
node datediff-cli "01 01 1990" "01 03 2017"     # 9921
node datediff-cli "01 01 1990" "01 03 9999"     # 2925286
node datediff-cli "29 02 1990" "01 03 9999"     # generate error

Notes:

It requires ES6 support, i.e., Node.js v6.10.0+

Keywords

date

FAQs

Package last updated on 15 Jun 2017

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