@@ -90,7 +90,7 @@ module.exports = function setConvert(ax, fullLayout) {
9090 * - inserts a dummy arg so calendar is the 3rd arg (see notes below).
9191 * - defaults to ax.calendar
9292 */
93- function dt2ms ( v , _ , calendar ) {
93+ function dt2ms ( v , _ , calendar , msUTC ) {
9494 // NOTE: Changed this behavior: previously we took any numeric value
9595 // to be a ms, even if it was a string that could be a bare year.
9696 // Now we convert it as a date if at all possible, and only try
@@ -106,7 +106,12 @@ module.exports = function setConvert(ax, fullLayout) {
106106
107107 var d = new Date ( msRounded ) ;
108108 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+ }
110115 } else return BADNUM ;
111116 }
112117 return ms ;
@@ -794,7 +799,7 @@ module.exports = function setConvert(ax, fullLayout) {
794799 // the first letter of ax._id?)
795800 // in case the expected data isn't there, make a list of
796801 // integers based on the opposite data
797- ax . makeCalcdata = function ( trace , axLetter ) {
802+ ax . makeCalcdata = function ( trace , axLetter , msUTC ) {
798803 var arrayIn , arrayOut , i , len ;
799804
800805 var axType = ax . type ;
@@ -818,10 +823,10 @@ module.exports = function setConvert(ax, fullLayout) {
818823
819824 arrayOut = new Array ( len ) ;
820825 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 ) ;
822827 }
823828 } 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 ;
825830 var dv = ( trace [ 'd' + axLetter ] ) ? Number ( trace [ 'd' + axLetter ] ) : 1 ;
826831
827832 // the opposing data, for size if we have x and dx etc
0 commit comments