chronokinesis
Advanced tools
Comparing version 3.1.1 to 3.1.2
@@ -156,10 +156,11 @@ var chronokinesis = (function (exports) { | ||
var dt = instantiate(NativeDate, args); | ||
dt.getTimezoneOffset = function getTimezoneOffset() { | ||
var curr = nativeGetTimezoneOffset.call(this); | ||
if (!iana) return curr; | ||
var tz = timezone(iana).getTime(this); | ||
return Math.round((tz - this.getTime()) / 60000) + curr; | ||
}; | ||
Object.defineProperty(dt, 'getTimezoneOffset', { | ||
enumerable: false, | ||
value: function getTimezoneOffset() { | ||
var curr = nativeGetTimezoneOffset.call(this); | ||
if (!iana) return curr; | ||
var tz = timezone(iana).getTime(this); | ||
return Math.round((tz - this.getTime()) / 60000) + curr; | ||
} | ||
}); | ||
return dt; | ||
@@ -166,0 +167,0 @@ } |
@@ -153,10 +153,11 @@ function ownKeys(object, enumerableOnly) { | ||
var dt = instantiate(NativeDate, args); | ||
dt.getTimezoneOffset = function getTimezoneOffset() { | ||
var curr = nativeGetTimezoneOffset.call(this); | ||
if (!iana) return curr; | ||
var tz = timezone(iana).getTime(this); | ||
return Math.round((tz - this.getTime()) / 60000) + curr; | ||
}; | ||
Object.defineProperty(dt, 'getTimezoneOffset', { | ||
enumerable: false, | ||
value: function getTimezoneOffset() { | ||
var curr = nativeGetTimezoneOffset.call(this); | ||
if (!iana) return curr; | ||
var tz = timezone(iana).getTime(this); | ||
return Math.round((tz - this.getTime()) / 60000) + curr; | ||
} | ||
}); | ||
return dt; | ||
@@ -163,0 +164,0 @@ } |
15
index.js
@@ -26,9 +26,12 @@ /** | ||
dt.getTimezoneOffset = function getTimezoneOffset() { | ||
const curr = nativeGetTimezoneOffset.call(this); | ||
if (!iana) return curr; | ||
Object.defineProperty(dt, 'getTimezoneOffset', { | ||
enumerable: false, | ||
value: function getTimezoneOffset() { | ||
const curr = nativeGetTimezoneOffset.call(this); | ||
if (!iana) return curr; | ||
const tz = timezone(iana).getTime(this); | ||
return Math.round((tz - this.getTime()) / 60000) + curr; | ||
}; | ||
const tz = timezone(iana).getTime(this); | ||
return Math.round((tz - this.getTime()) / 60000) + curr; | ||
}, | ||
}); | ||
@@ -35,0 +38,0 @@ return dt; |
{ | ||
"name": "chronokinesis", | ||
"version": "3.1.1", | ||
"version": "3.1.2", | ||
"description": "Module for testing time-dependent code", | ||
@@ -5,0 +5,0 @@ "author": { |
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
28926
747