Skip to content

Commit 93c4b70

Browse files
committed
fix intendation
1 parent ddee91e commit 93c4b70

17 files changed

+78
-40
lines changed

src/scales/scale.time.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,6 @@ var defaultConfig = {
449449
adapters: {},
450450
time: {
451451
parser: false, // false == a pattern string from https://momentjs.com/docs/#/parsing/string-format/ or a custom callback that converts its argument to a moment
452-
format: false, // DEPRECATED false == date objects, moment object, callback or a pattern string from https://momentjs.com/docs/#/parsing/string-format/
453452
unit: false, // false == automatic or override with week, month, year, etc.
454453
round: false, // none, or override with week, month, year, etc.
455454
displayFormat: false, // DEPRECATED

test/fixtures/controller.bar/bar-thickness-absolute.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@
2020
"barPercentage": 1,
2121
"categoryPercentage": 1,
2222
"barThickness": 128,
23+
"time": {
24+
"parser": "YYYY"
25+
},
2326
"ticks": {
2427
"source": "labels"
2528
}

test/fixtures/controller.bar/bar-thickness-flex-offset.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@
2020
"barPercentage": 1,
2121
"categoryPercentage": 1,
2222
"barThickness": "flex",
23+
"time": {
24+
"parser": "YYYY"
25+
},
2326
"ticks": {
2427
"source": "labels"
2528
}

test/fixtures/controller.bar/bar-thickness-flex-single-reverse.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
"barThickness": "flex",
2020
"barPercentage": 1,
2121
"categoryPercentage": 1,
22+
"time": {
23+
"parser": "YYYY"
24+
},
2225
"ticks": {
2326
"source": "labels",
2427
"reverse": true

test/fixtures/controller.bar/bar-thickness-flex-single.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
"barThickness": "flex",
2020
"barPercentage": 1,
2121
"categoryPercentage": 1,
22+
"time": {
23+
"parser": "YYYY"
24+
},
2225
"ticks": {
2326
"source": "labels"
2427
}

test/fixtures/controller.bar/bar-thickness-flex.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
"barPercentage": 1,
2020
"categoryPercentage": 1,
2121
"barThickness": "flex",
22+
"time": {
23+
"parser": "YYYY"
24+
},
2225
"ticks": {
2326
"source": "labels"
2427
}

test/fixtures/controller.bar/bar-thickness-max.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
"barPercentage": 1,
2020
"categoryPercentage": 1,
2121
"maxBarThickness": 8,
22+
"time": {
23+
"parser": "YYYY"
24+
},
2225
"ticks": {
2326
"source": "labels"
2427
}

test/fixtures/controller.bar/bar-thickness-min-interval.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
"display": false,
1919
"barPercentage": 1,
2020
"categoryPercentage": 1,
21+
"time": {
22+
"parser": "YYYY"
23+
},
2124
"ticks": {
2225
"source": "labels"
2326
}

test/fixtures/controller.bar/bar-thickness-multiple.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@
2424
"display": false,
2525
"barPercentage": 1,
2626
"categoryPercentage": 1,
27+
"time": {
28+
"parser": "YYYY"
29+
},
2730
"ticks": {
2831
"source": "labels"
2932
}

test/fixtures/controller.bar/bar-thickness-no-overlap.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@
2424
"display": false,
2525
"barPercentage": 1,
2626
"categoryPercentage": 1,
27+
"time": {
28+
"parser": "YYYY-MM"
29+
},
2730
"ticks": {
2831
"source": "labels"
2932
}

test/fixtures/controller.bar/bar-thickness-offset.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@
2525
"display": false,
2626
"barPercentage": 1,
2727
"categoryPercentage": 1,
28+
"time": {
29+
"parser": "YYYY"
30+
},
2831
"ticks": {
2932
"source": "labels"
3033
}

test/fixtures/controller.bar/bar-thickness-reverse.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@
2424
"display": false,
2525
"barPercentage": 1,
2626
"categoryPercentage": 1,
27+
"time": {
28+
"parser": "YYYY"
29+
},
2730
"ticks": {
2831
"source": "labels",
2932
"reverse": true

test/fixtures/controller.bar/bar-thickness-single-xy.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
"display": false,
1919
"barPercentage": 1,
2020
"categoryPercentage": 1,
21+
"time": {
22+
"parser": "YYYY"
23+
},
2124
"ticks": {
2225
"source": "labels"
2326
}

test/fixtures/controller.bar/bar-thickness-single.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,11 @@
1818
"display": false,
1919
"barPercentage": 1,
2020
"categoryPercentage": 1,
21-
"ticks": {
22-
"source": "labels"
23-
},
2421
"time": {
22+
"parser": "YYYY"
23+
},
24+
"ticks": {
25+
"source": "labels",
2526
"min": "2013"
2627
}
2728
}],

test/fixtures/controller.bar/bar-thickness-stacked.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@
2525
"display": false,
2626
"barPercentage": 1,
2727
"categoryPercentage": 1,
28+
"time": {
29+
"parser": "YYYY"
30+
},
2831
"ticks": {
2932
"source": "labels"
3033
}

test/specs/core.controller.tests.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1170,7 +1170,7 @@ describe('Chart', function() {
11701170
responsive: true,
11711171
scales: {
11721172
xAxes: [{
1173-
type: 'time'
1173+
type: 'category'
11741174
}],
11751175
yAxes: [{
11761176
scaleLabel: {

test/specs/scale.time.tests.js

Lines changed: 34 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ describe('Time scale tests', function() {
9797
},
9898
time: {
9999
parser: false,
100-
format: false,
101100
unit: false,
102101
round: false,
103102
isoWeekday: false,
@@ -433,28 +432,28 @@ describe('Time scale tests', function() {
433432
});
434433

435434
it('should use the min option when less than first label for building ticks', function() {
436-
config.time.min = '2014-12-29T04:00:00';
435+
config.ticks.min = '2014-12-29T04:00:00';
437436

438437
var scale = createScale(mockData, config);
439438
expect(scale.ticks[0]).toEqual('Jan 1');
440439
});
441440

442441
it('should use the min option when greater than first label for building ticks', function() {
443-
config.time.min = '2015-01-02T04:00:00';
442+
config.ticks.min = '2015-01-02T04:00:00';
444443

445444
var scale = createScale(mockData, config);
446445
expect(scale.ticks[0]).toEqual('Jan 2');
447446
});
448447

449448
it('should use the max option when greater than last label for building ticks', function() {
450-
config.time.max = '2015-01-05T06:00:00';
449+
config.ticks.max = '2015-01-05T06:00:00';
451450

452451
var scale = createScale(mockData, config);
453452
expect(scale.ticks[scale.ticks.length - 1]).toEqual('Jan 3');
454453
});
455454

456455
it('should use the max option when less than last label for building ticks', function() {
457-
config.time.max = '2015-01-02T23:00:00';
456+
config.ticks.max = '2015-01-02T23:00:00';
458457

459458
var scale = createScale(mockData, config);
460459
expect(scale.ticks[scale.ticks.length - 1]).toEqual('Jan 2');
@@ -853,7 +852,7 @@ describe('Time scale tests', function() {
853852
scales: {
854853
xAxes: [{
855854
type: 'time',
856-
time: {
855+
ticks: {
857856
min: moment().subtract(1, 'months'),
858857
max: moment(),
859858
}
@@ -910,8 +909,8 @@ describe('Time scale tests', function() {
910909
var scale = chart.scales.x;
911910
var options = chart.options.scales.xAxes[0];
912911

913-
options.time.min = '2012';
914-
options.time.max = '2051';
912+
options.ticks.min = '2012';
913+
options.ticks.max = '2051';
915914
chart.update();
916915

917916
expect(scale.min).toEqual(+moment('2012', 'YYYY'));
@@ -924,8 +923,8 @@ describe('Time scale tests', function() {
924923
var scale = chart.scales.x;
925924
var options = chart.options.scales.xAxes[0];
926925

927-
options.time.min = '2017';
928-
options.time.max = '2042';
926+
options.ticks.min = '2017';
927+
options.ticks.max = '2042';
929928
chart.update();
930929

931930
expect(scale.min).toEqual(+moment('2017', 'YYYY'));
@@ -1004,8 +1003,8 @@ describe('Time scale tests', function() {
10041003
var scale = chart.scales.x;
10051004
var options = chart.options.scales.xAxes[0];
10061005

1007-
options.time.min = '2012';
1008-
options.time.max = '2051';
1006+
options.ticks.min = '2012';
1007+
options.ticks.max = '2051';
10091008
chart.update();
10101009

10111010
expect(scale.min).toEqual(+moment('2012', 'YYYY'));
@@ -1018,8 +1017,8 @@ describe('Time scale tests', function() {
10181017
var scale = chart.scales.x;
10191018
var options = chart.options.scales.xAxes[0];
10201019

1021-
options.time.min = '2017';
1022-
options.time.max = '2043';
1020+
options.ticks.min = '2017';
1021+
options.ticks.max = '2043';
10231022
chart.update();
10241023

10251024
expect(scale.min).toEqual(+moment('2017', 'YYYY'));
@@ -1103,7 +1102,7 @@ describe('Time scale tests', function() {
11031102
var scale = chart.scales.x;
11041103
var options = chart.options.scales.xAxes[0];
11051104

1106-
options.time.min = '2012';
1105+
options.ticks.min = '2012';
11071106
chart.update();
11081107

11091108
var start = scale.left;
@@ -1117,7 +1116,7 @@ describe('Time scale tests', function() {
11171116
var scale = chart.scales.x;
11181117
var options = chart.options.scales.xAxes[0];
11191118

1120-
options.time.max = '2050';
1119+
options.ticks.max = '2050';
11211120
chart.update();
11221121

11231122
var start = scale.left;
@@ -1131,8 +1130,8 @@ describe('Time scale tests', function() {
11311130
var scale = chart.scales.x;
11321131
var options = chart.options.scales.xAxes[0];
11331132

1134-
options.time.min = '2012';
1135-
options.time.max = '2050';
1133+
options.ticks.min = '2012';
1134+
options.ticks.max = '2050';
11361135
chart.update();
11371136

11381137
var start = scale.left;
@@ -1187,8 +1186,8 @@ describe('Time scale tests', function() {
11871186
var scale = chart.scales.x;
11881187
var options = chart.options.scales.xAxes[0];
11891188

1190-
options.time.min = '2012';
1191-
options.time.max = '2050';
1189+
options.ticks.min = '2012';
1190+
options.ticks.max = '2050';
11921191
chart.update();
11931192

11941193
var start = scale.left;
@@ -1280,7 +1279,7 @@ describe('Time scale tests', function() {
12801279
});
12811280
});
12821281

1283-
describe('when time.min and/or time.max are defined', function() {
1282+
describe('when ticks.min and/or ticks.max are defined', function() {
12841283
['auto', 'data', 'labels'].forEach(function(source) {
12851284
['data', 'ticks'].forEach(function(bounds) {
12861285
describe('and ticks.source is "' + source + '" and bounds "' + bounds + '"', function() {
@@ -1320,8 +1319,8 @@ describe('Time scale tests', function() {
13201319
var min = '02/19 07:00';
13211320
var max = '02/24 08:00';
13221321

1323-
options.time.min = min;
1324-
options.time.max = max;
1322+
options.ticks.min = min;
1323+
options.ticks.max = max;
13251324
chart.update();
13261325

13271326
expect(scale.min).toEqual(+moment(min, 'MM/DD HH:mm'));
@@ -1340,8 +1339,8 @@ describe('Time scale tests', function() {
13401339
var min = '02/21 07:00';
13411340
var max = '02/22 20:00';
13421341

1343-
options.time.min = min;
1344-
options.time.max = max;
1342+
options.ticks.min = min;
1343+
options.ticks.max = max;
13451344
chart.update();
13461345

13471346
expect(scale.min).toEqual(+moment(min, 'MM/DD HH:mm'));
@@ -1414,8 +1413,8 @@ describe('Time scale tests', function() {
14141413
var scale = chart.scales.x;
14151414
var options = chart.options.scales.xAxes[0];
14161415

1417-
options.time.min = '2012';
1418-
options.time.max = '2051';
1416+
options.ticks.min = '2012';
1417+
options.ticks.max = '2051';
14191418
chart.update();
14201419

14211420
expect(scale.getPixelForValue('2012')).toBeCloseToPixel(scale.left);
@@ -1427,8 +1426,8 @@ describe('Time scale tests', function() {
14271426
var scale = chart.scales.x;
14281427
var options = chart.options.scales.xAxes[0];
14291428

1430-
options.time.min = '2012';
1431-
options.time.max = '2051';
1429+
options.ticks.min = '2012';
1430+
options.ticks.max = '2051';
14321431
options.offset = true;
14331432
chart.update();
14341433

@@ -1541,7 +1540,7 @@ describe('Time scale tests', function() {
15411540
var scale = chart.scales.x;
15421541
var options = chart.options.scales.xAxes[0];
15431542

1544-
options.time.min = '2012';
1543+
options.ticks.min = '2012';
15451544
chart.update();
15461545

15471546
var start = scale.left;
@@ -1556,7 +1555,7 @@ describe('Time scale tests', function() {
15561555
var scale = chart.scales.x;
15571556
var options = chart.options.scales.xAxes[0];
15581557

1559-
options.time.max = '2050';
1558+
options.ticks.max = '2050';
15601559
chart.update();
15611560

15621561
var start = scale.left;
@@ -1571,8 +1570,8 @@ describe('Time scale tests', function() {
15711570
var scale = chart.scales.x;
15721571
var options = chart.options.scales.xAxes[0];
15731572

1574-
options.time.min = '2012';
1575-
options.time.max = '2050';
1573+
options.ticks.min = '2012';
1574+
options.ticks.max = '2050';
15761575
chart.update();
15771576

15781577
var start = scale.left;
@@ -1629,8 +1628,8 @@ describe('Time scale tests', function() {
16291628
var scale = chart.scales.x;
16301629
var options = chart.options.scales.xAxes[0];
16311630

1632-
options.time.min = '2012';
1633-
options.time.max = '2050';
1631+
options.ticks.min = '2012';
1632+
options.ticks.max = '2050';
16341633
chart.update();
16351634

16361635
var start = scale.left;

0 commit comments

Comments
 (0)