timezone-mock
Advanced tools
Comparing version 0.0.5 to 0.0.6
@@ -292,3 +292,114 @@ // Generated this data from mysql_tzinfo_to_sql included with MySQL and the | ||
], | ||
}, | ||
'Brazil/East': { | ||
names: [-2, '-02', -3, '-03'], | ||
transitions: [ | ||
0, -3, | ||
499748400, -2, | ||
511236000, -3, | ||
530593200, -2, | ||
540266400, -3, | ||
562129200, -2, | ||
571197600, -3, | ||
592974000, -2, | ||
602042400, -3, | ||
624423600, -2, | ||
634701600, -3, | ||
656478000, -2, | ||
666756000, -3, | ||
687927600, -2, | ||
697600800, -3, | ||
719982000, -2, | ||
728445600, -3, | ||
750826800, -2, | ||
761709600, -3, | ||
782276400, -2, | ||
793159200, -3, | ||
813726000, -2, | ||
824004000, -3, | ||
844570800, -2, | ||
856058400, -3, | ||
876106800, -2, | ||
888717600, -3, | ||
908074800, -2, | ||
919562400, -3, | ||
938919600, -2, | ||
951616800, -3, | ||
970974000, -2, | ||
982461600, -3, | ||
1003028400, -2, | ||
1013911200, -3, | ||
1036292400, -2, | ||
1045360800, -3, | ||
1066532400, -2, | ||
1076810400, -3, | ||
1099364400, -2, | ||
1108864800, -3, | ||
1129431600, -2, | ||
1140314400, -3, | ||
1162695600, -2, | ||
1172368800, -3, | ||
1192330800, -2, | ||
1203213600, -3, | ||
1224385200, -2, | ||
1234663200, -3, | ||
1255834800, -2, | ||
1266717600, -3, | ||
1287284400, -2, | ||
1298167200, -3, | ||
1318734000, -2, | ||
1330221600, -3, | ||
1350788400, -2, | ||
1361066400, -3, | ||
1382238000, -2, | ||
1392516000, -3, | ||
1413687600, -2, | ||
1424570400, -3, | ||
1445137200, -2, | ||
1456020000, -3, | ||
1476586800, -2, | ||
1487469600, -3, | ||
1508036400, -2, | ||
1518919200, -3, | ||
1540090800, -2, | ||
1550368800, -3, | ||
1571540400, -2, | ||
1581818400, -3, | ||
1602990000, -2, | ||
1613872800, -3, | ||
1634439600, -2, | ||
1645322400, -3, | ||
1665889200, -2, | ||
1677376800, -3, | ||
1697338800, -2, | ||
1708221600, -3, | ||
1729393200, -2, | ||
1739671200, -3, | ||
1760842800, -2, | ||
1771725600, -3, | ||
1792292400, -2, | ||
1803175200, -3, | ||
1823742000, -2, | ||
1834624800, -3, | ||
1855191600, -2, | ||
1866074400, -3, | ||
1887246000, -2, | ||
1897524000, -3, | ||
1918695600, -2, | ||
1928973600, -3, | ||
1950145200, -2, | ||
1960423200, -3, | ||
1981594800, -2, | ||
1992477600, -3, | ||
2013044400, -2, | ||
2024532000, -3, | ||
2044494000, -2, | ||
2055376800, -3, | ||
2076548400, -2, | ||
2086826400, -3, | ||
2107998000, -2, | ||
2118880800, -3, | ||
2139447600, -2, | ||
] | ||
} | ||
}; |
{ | ||
"name": "timezone-mock", | ||
"version": "0.0.5", | ||
"version": "0.0.6", | ||
"description": "A JavaScript library to mock the local timezone.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -29,3 +29,3 @@ timezone-mock | ||
var result_pacific = buggyCode(); | ||
timezone_mock.register('US/Pacific'); | ||
timezone_mock.register('US/Eastern'); | ||
var result_eastern = buggyCode(); | ||
@@ -49,2 +49,3 @@ assert.equal(result_local, result_pacific); // Might fail | ||
* US/Eastern | ||
* Brazil/East | ||
* UTC | ||
@@ -54,3 +55,6 @@ | ||
all timezones (import factor is to test on a timezone with Daylight Saving | ||
Time if your local timezone does not). | ||
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. | ||
@@ -57,0 +61,0 @@ Status |
@@ -52,1 +52,8 @@ var assert = require('assert'); | ||
assert.equal(new Date(2017, 5).getTime(), new Date(2017, 5, 1, 0, 0, 0, 0).getTime()); | ||
////////////////////////////////////////////////////////////////////////// | ||
// Test Brazil timezone oddities | ||
timezone_mock.register('Brazil/East'); | ||
test_str = '2017-10-15 00:00:00.000'; // Midnight on this day doesn't exist, jumps to 11PM previous day | ||
assert.equal(1508032800000, new Date(test_str).getTime()); | ||
assert.equal(1508032800000, new Date(2017, 9, 15, 0, 0, 0, 0).getTime()); |
Sorry, the diff of this file is not supported yet
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
26757
742
69