File tree Expand file tree Collapse file tree 1 file changed +11
-11
lines changed Expand file tree Collapse file tree 1 file changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -60,6 +60,14 @@ var INTERVALS = {
60
60
61
61
var UNITS = Object . keys ( INTERVALS ) ;
62
62
63
+ function deprecated ( value , previous , current ) {
64
+ if ( value !== undefined ) {
65
+ console . warn (
66
+ 'time scale: "' + previous + '" is deprecated. ' +
67
+ 'Please use "' + current + '" instead' ) ;
68
+ }
69
+ }
70
+
63
71
function sorter ( a , b ) {
64
72
return a - b ;
65
73
}
@@ -481,17 +489,9 @@ module.exports = Scale.extend({
481
489
var adapter = me . _adapter = new adapters . _date ( options . adapters . date ) ;
482
490
483
491
// DEPRECATIONS: output a message only one time per update
484
- if ( time . format ) {
485
- console . warn ( 'options.time.format is deprecated and replaced by options.time.parser.' ) ;
486
- }
487
-
488
- if ( time . min ) {
489
- console . warn ( 'options.time.min is deprecated. Please use options.ticks.min' ) ;
490
- }
491
-
492
- if ( time . max ) {
493
- console . warn ( 'options.time.max is deprecated. Please use options.ticks.max' ) ;
494
- }
492
+ deprecated ( time . format , 'time.format' , 'time.parser' ) ;
493
+ deprecated ( time . min , 'time.min' , 'ticks.min' ) ;
494
+ deprecated ( time . max , 'time.max' , 'ticks.max' ) ;
495
495
496
496
// Backward compatibility: before introducing adapter, `displayFormats` was
497
497
// supposed to contain *all* unit/string pairs but this can't be resolved
You can’t perform that action at this time.
0 commit comments