Dana Dana - 1 month ago 7x
Javascript Question

DateRangeSlider change min formatted bound on button click

I'm working with the DateRangeSlider (JQRangeSlider) for the first time and I used it as a time slider: JSFiddle

The thing is that I need to change the min formatted bound whenever a button is clicked, for example in the Fiddle the min formatted value is 00:00 and when the button is pressed it should change to 05:00.

I've tried using:

$("#slider").dateRangeSlider("bounds", new Date("2016-01-01T05:00:00Z"), max2);

but the min formatted bound didn't change to 05:00.

Is there a way to change the min formatted bound from 00:00 to 05:00 when a button is clicked?


Add this for button's click event

 $("#slider").dateRangeSlider({bounds:{ min:new Date("2014-01-01T05:00:00Z"), max:max2 } });