timezone-mock
Advanced tools
Comparing version 1.0.6 to 1.0.7
@@ -10,2 +10,5 @@ var assert = require('assert'); | ||
var weekDays = ['Sun', 'Mon','Tue', 'Wed', 'Thu', 'Fri', 'Sat']; | ||
var months = ['Jan', 'Feb', 'Mar', 'Apr', 'Jun', 'Jul', 'Aug', 'Sept', 'Oct', 'Nov', 'Dec']; | ||
var HOUR = 60 * 60 * 1000; | ||
@@ -168,2 +171,6 @@ | ||
MockDate.prototype.toDateString = function () { | ||
return `${ weekDays[this.getDay()] } ${ months[this.getMonth()] } ${ this.getDate().toString().padStart(2, '0') } ${ this.getFullYear() }`; | ||
}; | ||
// TODO: | ||
@@ -170,0 +177,0 @@ // 'toDateString', |
{ | ||
"name": "timezone-mock", | ||
"version": "1.0.6", | ||
"version": "1.0.7", | ||
"description": "A JavaScript library to mock the local timezone.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -63,9 +63,11 @@ timezone-mock | ||
* UTC | ||
* Europe/London | ||
I found that testing on these three were enough to ensure code worked in | ||
all timezones (import factor is to test on a timezone with Daylight Saving | ||
all timezones (important factor is to test on a timezone with Daylight Saving | ||
Time if your local timezone does not). Brazil/East has the unique characteristic | ||
of having the DST transition happen right at midnight, so code that sets a Date | ||
object to midnight on a particular day and then does operations on that Date | ||
object is especially vulnerable in that timezone. | ||
object is especially vulnerable in that timezone. Europe/London is included as | ||
a timezone that is a positive offset from UTC. | ||
@@ -72,0 +74,0 @@ Status |
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
23309
712
84