trump-time-units
See time in terms of the Trump presidency
Last updated 3 years ago by chadian .
MIT · Original npm · Tarball · package.json
$ cnpm install trump-time-units 
SYNC missed versions from official npm registry.

trump-time-units Build Status

An npm module that aims to help put into perspective the new phenomenon of time under Trump. Time seems to move both quickly and slowly leading to many questions on Trump's effect on time. Until further research can be done this project aims to compare various trump time units against constant real time.

Usage

Units

  • comey
  • yates
  • bannon
  • priebus
  • spicer
  • flynn

trumpTimeUnits with start and end dates

trumpTimeUnits(start, end, units)

  • @param { Date|Moment } start - Start date, can be a javascript date object or moment date object
  • @param { Date|Moment } end - End date, can be a javascript date object or moment date object
  • @param { String } units One of the available units (see above)

trumpTimeUnits with duration in milliseconds

trumpTimeUnits(duration, units)

  • @param { Number } duration - The length of time in milliseconds
  • @param { String } units - One of the available units (see above)

Examples

Use moment as a helper to get things into a usable format

const moment = require('moment');
const trumpTimeUnits = require('trump-time-units');

// using a known duration in milliseconds
const twentyDays = moment.duration(20, 'days').asMilliseconds();
console.log(`20 days is ${trumpTimeUnits(twentyDays, 'scaramucci')} scaramucci's`);
// » 20 days is 2 scaramucci's

// using a start and end date
const start = new Date('2017-01-01');
const end = new Date('2017-07-04');
console.log(`
Between Janauary 1, 2017
and July 4, 2017
is ${trumpTimeUnits(start, end, 'comey')} yates's`);
// » Between Janauary 1, 2017
// and July 4, 2017
// is 1.6810049487883312 yates's

Additional Resources

Current Tags

  • 1.2.0                                ...           latest (3 years ago)

2 Versions

  • 1.2.0                                ...           3 years ago
  • 1.1.0                                ...           3 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 2
Dependencies (2)
Dev Dependencies (10)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |