@@ -90,7 +90,7 @@ module.exports = function setConvert(ax, fullLayout) {
90
90
* - inserts a dummy arg so calendar is the 3rd arg (see notes below).
91
91
* - defaults to ax.calendar
92
92
*/
93
- function dt2ms ( v , _ , calendar ) {
93
+ function dt2ms ( v , _ , calendar , msUTC ) {
94
94
// NOTE: Changed this behavior: previously we took any numeric value
95
95
// to be a ms, even if it was a string that could be a bare year.
96
96
// Now we convert it as a date if at all possible, and only try
@@ -106,7 +106,12 @@ module.exports = function setConvert(ax, fullLayout) {
106
106
107
107
var d = new Date ( msRounded ) ;
108
108
ms = dateTime2ms ( d ) + msecTenths / 10 ;
109
- ms += d . getTimezoneOffset ( ) * ONEMIN ;
109
+ if ( msUTC ) {
110
+ // For now it is only used
111
+ // to fix bar length in milliseconds.
112
+ // It could be applied in other places in v2
113
+ ms += d . getTimezoneOffset ( ) * ONEMIN ;
114
+ }
110
115
} else return BADNUM ;
111
116
}
112
117
return ms ;
@@ -794,7 +799,7 @@ module.exports = function setConvert(ax, fullLayout) {
794
799
// the first letter of ax._id?)
795
800
// in case the expected data isn't there, make a list of
796
801
// integers based on the opposite data
797
- ax . makeCalcdata = function ( trace , axLetter ) {
802
+ ax . makeCalcdata = function ( trace , axLetter , msUTC ) {
798
803
var arrayIn , arrayOut , i , len ;
799
804
800
805
var axType = ax . type ;
@@ -818,10 +823,10 @@ module.exports = function setConvert(ax, fullLayout) {
818
823
819
824
arrayOut = new Array ( len ) ;
820
825
for ( i = 0 ; i < len ; i ++ ) {
821
- arrayOut [ i ] = ax . d2c ( arrayIn [ i ] , 0 , cal ) ;
826
+ arrayOut [ i ] = ax . d2c ( arrayIn [ i ] , 0 , cal , msUTC ) ;
822
827
}
823
828
} else {
824
- var v0 = ( ( axLetter + '0' ) in trace ) ? ax . d2c ( trace [ axLetter + '0' ] , 0 , cal ) : 0 ;
829
+ var v0 = ( ( axLetter + '0' ) in trace ) ? ax . d2c ( trace [ axLetter + '0' ] , 0 , cal , false ) : 0 ;
825
830
var dv = ( trace [ 'd' + axLetter ] ) ? Number ( trace [ 'd' + axLetter ] ) : 1 ;
826
831
827
832
// the opposing data, for size if we have x and dx etc
0 commit comments