Skip to content

chadian/trump-time-units

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

trump-time-units Build Status npm version

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
  • scaramucci

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')} comey's`
);
// » Between Janauary 1, 2017
// and July 4, 2017
// is 1.6810049487883312 comey's

Additional Resources

About

Convert from real time to Trump time units

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published