Skip to content
Browse files

more tests

  • Loading branch information...
1 parent 0678a74 commit 6432331db5910a2f182991c6916eff2f205e7c6e @longlho longlho committed
Showing with 4 additions and 13 deletions.
  1. +0 −10 spec/date.spec.js
  2. +1 −1 spec/tz.sync.spec.js
  3. +3 −2 src/date.js
View
10 spec/date.spec.js
@@ -227,14 +227,4 @@ describe('timezoneJS.Date', function () {
expect(dt.toString()).toEqual('2011-12-31 00:00:00');
expect(dt.getTime()).toEqual(t);
});
-
- it('should have correct DST time during transition', function () {
- console.log("\n\nTesting timezone-js transition millis...\n");
- var dt = new timezoneJS.Date(1162101599999, 'America/New_York');
- expect(dt.getTimezoneAbbreviation()).toEqual('EDT');
- dt = new timezoneJS.Date(1162101600000, 'America/New_York');
- expect(dt.getTimezoneAbbreviation()).toEqual('EST');
- dt = new timezoneJS.Date(1162101600000 + 3600*1000, 'America/New_York');
- expect(dt.getTimezoneAbbreviation()).toEqual('EST');
- });
});
View
2 spec/tz.sync.spec.js
@@ -43,7 +43,7 @@ describe('TimezoneJS', function () {
});
it('should get New_York time correctly', function () {
- // Source: http://www.timeanddate.com/worldclock/city.html?n=110
+ // Source: http://www.timeanddate.com/worldclock/city.html?n=179
// Changes every year!
var dt;
// 2006
View
5 src/date.js
@@ -471,8 +471,8 @@
mon = SHORT_MONTHS[z[4].substr(0, 3)];
dat = parseInt(z[5], 10) || 1;
}
- var string = z[6] ? z[6] : '00:00:00',
- t = parseTimeString(string);
+ var string = z[6] ? z[6] : '00:00:00'
+ , t = parseTimeString(string);
return [yea, mon, dat, t[1], t[2], t[3]];
}
function getZone(dt, tz) {
@@ -689,6 +689,7 @@
//The previous rule does not really apply, take the one before that.
return applicableRules[pinpoint - 2][1];
} else if (pinpoint > 0 && pinpoint < applicableRules.length - 1 && compareDates(date, applicableRules[pinpoint+1], applicableRules[pinpoint-1][1]) > 0) {
+
//The next rule does already apply, take that one.
return applicableRules[pinpoint + 1][1];
} else if (pinpoint === 0) {

0 comments on commit 6432331

Please sign in to comment.
Something went wrong with that request. Please try again.