Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit bb5bec3

Browse files
committed
add simple early return
1 parent 2ae0fdf commit bb5bec3

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

src/plots/cartesian/set_convert.js

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -99,19 +99,18 @@ module.exports = function setConvert(ax, fullLayout) {
9999
if(ms === BADNUM) {
100100
if(isNumeric(v)) {
101101
v = +v;
102-
// keep track of tenths of ms, that `new Date` will drop
103-
// same logic as in Lib.ms2DateTime
104-
var msecTenths = Math.floor(Lib.mod(v + 0.05, 1) * 10);
105-
var msRounded = Math.round(v - msecTenths / 10);
106-
107-
var d = new Date(msRounded);
108-
ms = dateTime2ms(d) + msecTenths / 10;
109102
if(msUTC) {
110103
// For now it is only used
111104
// to fix bar length in milliseconds.
112105
// It could be applied in other places in v2
113-
ms += d.getTimezoneOffset() * ONEMIN;
106+
return v;
114107
}
108+
109+
// keep track of tenths of ms, that `new Date` will drop
110+
// same logic as in Lib.ms2DateTime
111+
var msecTenths = Math.floor(Lib.mod(v + 0.05, 1) * 10);
112+
var msRounded = Math.round(v - msecTenths / 10);
113+
ms = dateTime2ms(new Date(msRounded)) + msecTenths / 10;
115114
} else return BADNUM;
116115
}
117116
return ms;

0 commit comments

Comments
 (0)