Skip to content

Commit 1e3dc58

Browse files
Merge pull request #8 from telerik/tests-timezone
test: use fixed timezone offset in the tests closes #2
2 parents e827d22 + 6b19140 commit 1e3dc58

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

test/dates.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ const calendar = require("cldr-data/main/bg/ca-gregorian.json");
99

1010
load(likelySubtags, timeZoneNames, calendar, require("cldr-data/main/ko/timeZoneNames.json"), require("cldr-data/main/ko/ca-gregorian.json"));
1111

12+
Date.prototype.getTimezoneOffset = function() {
13+
return -120;
14+
};
15+
1216
function date(year, month, day, hour, minute, second, millisecond) {
1317
var d = new Date();
1418

@@ -257,27 +261,22 @@ describe('date formatting', () => {
257261

258262
it('supports short localized GMT format', () => {
259263
expect(formatDate(date(2000, 2, 1), "z")).toEqual('GMT+2');
260-
expect(formatDate(date(2000, 4, 1), "z")).toEqual('GMT+3');
261264
});
262265

263266
it('supports long localized GMT format', () => {
264267
expect(formatDate(date(2000, 2, 1), "zzzz")).toEqual('GMT+02:00');
265-
expect(formatDate(date(2000, 4, 1), "zzzz")).toEqual('GMT+03:00');
266268
});
267269

268270
it('supports the ISO8601 basic format timezone format', () => {
269271
expect(formatDate(date(2000, 2, 1), "Z")).toEqual('+0200');
270-
expect(formatDate(date(2000, 4, 1), "Z")).toEqual('+0300');
271272
});
272273

273274
it('supports Z long localized GMT format', () => {
274275
expect(formatDate(date(2000, 2, 1), "ZZZZ")).toEqual('GMT+02:00');
275-
expect(formatDate(date(2000, 4, 1), "ZZZZ")).toEqual('GMT+03:00');
276276
});
277277

278278
it('supports the ISO8601 extended timezone format', () => {
279279
expect(formatDate(date(2000, 2, 1), "ZZZZZ")).toEqual('+02:00');
280-
expect(formatDate(date(2000, 4, 1), "ZZZZZ")).toEqual('+03:00');
281280
});
282281

283282
it('supports the x timezone format', () => {

0 commit comments

Comments
 (0)