Skip to content

Commit e8b587c

Browse files
committed
test: draggable shapes referenced to timestamps
1 parent 5c1ff68 commit e8b587c

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

test/jasmine/tests/shapes_test.js

+8-2
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,10 @@ describe('Test shapes', function() {
319319
// xaxis.type: 'date', yaxis.type: 'category'
320320
{
321321
title: 'linked to date and category axes',
322-
xaxis: { type: 'date', range: ['2000-01-01', '2000-01-02'] },
322+
xaxis: {
323+
type: 'date',
324+
range: ['2000-01-01', (new Date(2000, 1, 2)).getTime()]
325+
},
323326
yaxis: { type: 'category', range: ['a', 'b'] }
324327
}
325328
];
@@ -682,7 +685,10 @@ function getDataToPixel(gd, axis, isVertical) {
682685
}
683686

684687
function decodeDate(convertToPx) {
685-
return function(v) { return convertToPx(v.replace('_', ' ')); };
688+
return function(v) {
689+
if(v.replace) v = v.replace('_', ' ');
690+
return convertToPx(v);
691+
};
686692
}
687693

688694

0 commit comments

Comments
 (0)