d-nation / highstock-beyond-extremes

Highstock plugin for allowing the input range dates to be beyond the range of the current data in the chart
MIT License
3 stars 0 forks source link

useUTC - DST Problem #2

Open DragonflyNet67 opened 7 years ago

DragonflyNet67 commented 7 years ago

On Line 47 (value = value + new Date().getTimezoneOffset() 60 1000;) there is a problem with/on DST. Let's say in Europe we have March, 30th, 2017 and useUTC is set to false in Highcharts Settings and I want to switch the from/to Dates to 2017-01-01 / 2017-01-31 then both Dates are wrong by one or so hour. That means I get 2016-12-31 23:00 to 2017-01-30 23:00 as a result from the Plugin. Because now in March DST is active and it was not in January

highstock-beyond-extremes

DragonflyNet67 commented 7 years ago

I probably found a solution, but please could you verify this, since i am quite new to javascript. I added on line 44 following: var dat = new Date(value); and changed the line 47 to value = value + dat.getTimezoneOffset() 60 1000. For the moment I think it seems to work. For any "strange" reason the minutes are not zero.

highstock-beyond-extremes2