Comparing version 1.0.1 to 2.0.0
#!/usr/bin/env node | ||
function tDays () { | ||
var election = new Date(2016, 10, 8) | ||
var inaguration = new Date(2017, 0, 20) | ||
var now = new Date() | ||
return Math.floor((now - election) / (1000 * 60 * 60 * 24)) | ||
return Math.floor((now - inaguration) / (1000 * 60 * 60 * 24)) + 1 | ||
} | ||
@@ -8,0 +8,0 @@ |
{ | ||
"name": "tdays", | ||
"version": "1.0.1", | ||
"version": "2.0.0", | ||
"description": "get days since trump was elected", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
# t-days | ||
get days since Trump was elected | ||
![](https://img.shields.io/npm/v/tdays.svg) | ||
![](https://img.shields.io/npm/dt/tdays.svg) | ||
get number of days of Trump presidency | ||
## about | ||
📆 get "Trump day x" | ||
## source | ||
```js | ||
function tDays () { | ||
var election = new Date(2016, 10, 8) | ||
var inaguration = new Date(2017, 0, 20) | ||
var now = new Date() | ||
return Math.floor((now - election) / (1000 * 60 * 60 * 24)) | ||
return Math.floor((now - inaguration) / (1000 * 60 * 60 * 24)) + 1 | ||
} | ||
``` |
15
test.js
@@ -1,6 +0,13 @@ | ||
var test = require('tape') | ||
const test = require('tape') | ||
const tdays = require('./') | ||
test('test rig', function(t) { | ||
t.plan(1) | ||
t.equal(1,1) | ||
test('module', function(t) { | ||
t.plan(2) | ||
t.true(tdays instanceof Function) | ||
t.equal(typeof tdays, 'function') | ||
}) | ||
test('result', function(t) { | ||
t.plan(1) | ||
t.equal(typeof tdays(), 'number') | ||
}) |
1528
21
17