time-constants
Advanced tools
Comparing version 1.0.2 to 1.0.3
{ | ||
"name": "time-constants", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "Some constants for convenient amounts of time, all in ms", | ||
@@ -5,0 +5,0 @@ "main": "timeConstants.js", |
@@ -5,16 +5,23 @@ # time-constants | ||
```js | ||
'use strict' | ||
'use strict'; | ||
var SECOND = 1000 | ||
var MINUTE = 60 * SECOND | ||
var HOUR = 60 * MINUTE | ||
var DAY = 24 * HOUR | ||
var WEEK = 7 * DAY | ||
var YEAR = DAY * 365.24 | ||
var NORMAL_YEAR = DAY * 365 | ||
var LEAP_YEAR = DAY * 366 | ||
var DECADE = 10 * YEAR | ||
var HALF_YEAR = YEAR/2 | ||
var AVERAGE_MONTH = YEAR/12 | ||
const MILLISECONDS_PER_SECOND = 1000; | ||
const SECONDS_PER_MINUTE = 60; | ||
const MINUTES_PER_HOUR = 60; | ||
const HOURS_PER_DAY = 24; | ||
const DAYS_PER_WEEK = 7; | ||
const MONTHS_PER_YEAR = 12; | ||
const SECOND = MILLISECONDS_PER_SECOND; | ||
const MINUTE = SECOND * SECONDS_PER_MINUTE; | ||
const HOUR = MINUTE * MINUTES_PER_HOUR; | ||
const DAY = HOUR * HOURS_PER_DAY; | ||
const WEEK = DAY * DAYS_PER_WEEK; | ||
const YEAR = DAY * 365.24; | ||
const NORMAL_YEAR = DAY * 365; | ||
const LEAP_YEAR = DAY * 366; | ||
const DECADE = 10 * YEAR; | ||
const HALF_YEAR = YEAR/2; | ||
const AVERAGE_MONTH = YEAR/12; | ||
module.exports = { | ||
@@ -32,8 +39,14 @@ SECOND: SECOND | ||
, AVERAGE_MONTH : AVERAGE_MONTH | ||
// ±100,000,000 days, the min and max dates allowed in ECMA Script. | ||
// See: http://ecma-international.org/ecma-262/5.1/#sec-15.9.1.1 | ||
, MILLISECONDS_PER_SECOND : MILLISECONDS_PER_SECOND | ||
, SECONDS_PER_MINUTE : SECONDS_PER_MINUTE | ||
, MINUTES_PER_HOUR : MINUTES_PER_HOUR | ||
, HOURS_PER_DAY : HOURS_PER_DAY | ||
, DAYS_PER_WEEK : DAYS_PER_WEEK | ||
, MONTHS_PER_YEAR : MONTHS_PER_YEAR | ||
// ±100,000,000 days, the min and max dates allowed in ECMA Script. | ||
// See: http://ecma-international.org/ecma-262/5.1/#sec-15.9.1.1 | ||
, MIN_DATE : new Date(-8.64E15) | ||
, MAX_DATE : new Date(8.64E15) | ||
} | ||
}; | ||
``` |
@@ -1,15 +0,22 @@ | ||
'use strict' | ||
'use strict'; | ||
var SECOND = 1000 | ||
var MINUTE = 60 * SECOND | ||
var HOUR = 60 * MINUTE | ||
var DAY = 24 * HOUR | ||
var WEEK = 7 * DAY | ||
var YEAR = DAY * 365.24 | ||
var NORMAL_YEAR = DAY * 365 | ||
var LEAP_YEAR = DAY * 366 | ||
var DECADE = 10 * YEAR | ||
var HALF_YEAR = YEAR/2 | ||
var AVERAGE_MONTH = YEAR/12 | ||
const MILLISECONDS_PER_SECOND = 1000; | ||
const SECONDS_PER_MINUTE = 60; | ||
const MINUTES_PER_HOUR = 60; | ||
const HOURS_PER_DAY = 24; | ||
const DAYS_PER_WEEK = 7; | ||
const MONTHS_PER_YEAR = 12; | ||
const SECOND = MILLISECONDS_PER_SECOND; | ||
const MINUTE = SECOND * SECONDS_PER_MINUTE; | ||
const HOUR = MINUTE * MINUTES_PER_HOUR; | ||
const DAY = HOUR * HOURS_PER_DAY; | ||
const WEEK = DAY * DAYS_PER_WEEK; | ||
const YEAR = DAY * 365.24; | ||
const NORMAL_YEAR = DAY * 365; | ||
const LEAP_YEAR = DAY * 366; | ||
const DECADE = 10 * YEAR; | ||
const HALF_YEAR = YEAR/2; | ||
const AVERAGE_MONTH = YEAR/12; | ||
module.exports = { | ||
@@ -27,2 +34,8 @@ SECOND: SECOND | ||
, AVERAGE_MONTH : AVERAGE_MONTH | ||
, MILLISECONDS_PER_SECOND : MILLISECONDS_PER_SECOND | ||
, SECONDS_PER_MINUTE : SECONDS_PER_MINUTE | ||
, MINUTES_PER_HOUR : MINUTES_PER_HOUR | ||
, HOURS_PER_DAY : HOURS_PER_DAY | ||
, DAYS_PER_WEEK : DAYS_PER_WEEK | ||
, MONTHS_PER_YEAR : MONTHS_PER_YEAR | ||
@@ -33,2 +46,2 @@ // ±100,000,000 days, the min and max dates allowed in ECMA Script. | ||
, MAX_DATE : new Date(8.64E15) | ||
} | ||
}; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
41
51
3472
3