Comparing version 0.1.0 to 0.1.1
@@ -16,3 +16,5 @@ var difference = require('lodash.difference'); | ||
noon: function(d) { | ||
utc: utc, | ||
noon: function (d) { | ||
var date; | ||
@@ -28,18 +30,18 @@ if (d) { | ||
/* Diffrence between dates */ | ||
/* Difference between dates */ | ||
differenceInDays: function (d1, d2) { | ||
return trunc((d2 - d1) / constants.MS_IN_DAY); | ||
return trunc((utc(d2) - utc(d1)) / constants.MS_IN_DAY); | ||
}, | ||
differenceInHours: function (d1, d2) { | ||
return trunc((d2 - d1) / constants.MS_IN_HOUR); | ||
return trunc((utc(d2) - utc(d1)) / constants.MS_IN_HOUR); | ||
}, | ||
differenceInMinutes: function (d1, d2) { | ||
return trunc((d2 - d1) / constants.MS_IN_MINUTE); | ||
return trunc((utc(d2) - utc(d1)) / constants.MS_IN_MINUTE); | ||
}, | ||
differenceInSeconds: function (d1, d2) { | ||
return trunc((d2 - d1) / constants.MS_IN_SECOND); | ||
return trunc((utc(d2) - utc(d1)) / constants.MS_IN_SECOND); | ||
}, | ||
@@ -242,2 +244,7 @@ | ||
function utc(d) { | ||
return Date.UTC(d.getFullYear(), d.getMonth(), d.getDate(), d.getHours(), | ||
d.getMinutes(), d.getSeconds(), d.getMilliseconds()); | ||
} | ||
function isBetween(d, start, end, beforeFn, afterFn) { | ||
@@ -244,0 +251,0 @@ if (start > end) { |
{ | ||
"name": "instadate", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "instadate.js", |
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
22460
556