File tree Expand file tree Collapse file tree 2 files changed +35
-4
lines changed
Expand file tree Collapse file tree 2 files changed +35
-4
lines changed Original file line number Diff line number Diff line change 1+ /**
2+ * @fileoverview Test cases for DygraphOptions.
3+ */
4+
5+ import Dygraph from '../../src/dygraph' ;
6+
7+ describe ( "dygraph-data-types" , function ( ) {
8+
9+ cleanupAfterEach ( ) ;
10+
11+ var graph ;
12+
13+ beforeEach ( function ( ) {
14+ graph = document . getElementById ( "graph" ) ;
15+ } ) ;
16+
17+ /*
18+ * Test to ensure ints are correctly interpreted as ints and not as dates
19+ */
20+ it ( 'testNumberOfData' , function ( ) {
21+ var opts = {
22+ width : 480 ,
23+ height : 320
24+ } ;
25+ var data = "x y\n" +
26+ "20033000 1\n" +
27+ "20034000 2\n" +
28+ "20035000 3\n" +
29+ "20036000 4" ;
30+
31+ var g = new Dygraph ( graph , data , opts ) ;
32+ assert . deepEqual ( 4 , g . rawData_ . length ) ;
33+ } ) ;
34+ } ) ;
Original file line number Diff line number Diff line change @@ -2608,10 +2608,7 @@ Dygraph.prototype.detectTypeFromString_ = function(str) {
26082608 str . indexOf ( '/' ) >= 0 ||
26092609 isNaN ( parseFloat ( str ) ) ) {
26102610 isDate = true ;
2611- } else if ( str . length == 8 && str > '19700101' && str < '20371231' ) {
2612- // TODO(danvk): remove support for this format.
2613- isDate = true ;
2614- }
2611+ }
26152612
26162613 this . setXAxisOptions_ ( isDate ) ;
26172614} ;
You can’t perform that action at this time.
0 commit comments