Skip to content

Commit 2a57525

Browse files
committed
temp fix for histogram2d test in UTC environment
1 parent b4da924 commit 2a57525

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

test/jasmine/tests/histogram2d_test.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,10 @@ describe('Test histogram2d', function() {
7575
return out;
7676
}
7777

78-
// remove tzOffset when we move to UTC
79-
var oneDay = 24 * 3600000;
78+
// remove tzJan/tzJuly when we move to UTC
79+
var oneDay = 24 * 3600000,
80+
tzJan = (new Date(1970, 0, 1)).getTimezoneOffset(),
81+
tzJuly = (new Date(1970, 6, 1)).getTimezoneOffset();
8082

8183
it('should handle both uniform and nonuniform date bins', function() {
8284
var out = _calc({
@@ -95,7 +97,7 @@ describe('Test histogram2d', function() {
9597
// lets also make it display the bins with nonuniform size,
9698
// and ensure we don't generate an extra bin on the end (see
9799
// first row of z below)
98-
expect(out.y0).toBe('1969-07-02 15:24');
100+
expect(out.y0).toBe(tzJan === tzJuly ? '1969-07-02 14:24' : '1969-07-02 15:24');
99101
expect(out.dy).toBe(365.2 * oneDay);
100102

101103
expect(out.z).toEqual([

0 commit comments

Comments
 (0)