Question

I'm using jQDateRangeSlider in my project to enable users to choose flight dates. Here is an example: jsfiddle.net. There are two types of bounds:

  • Total bounds

    bounds: { min: new Date(2012, 0, 1), max: new Date(2012, 11, 31, 12, 59, 59) }

  • default selected range

    defaultValues: { min: new Date(2012, 1, 10), max: new Date(2012, 4, 22) }

Let's say I want to represent full year as total range(Jan - Dec). Users can select flight date(left label) and back date(right label) throughout the year. How can I set min for right slider lable no less than value in left label? Back flight date shouldn't be less than 1st date. Or in another words: how to disable all dates which is less than 1st selected date? According to documentation there is no standart solution to do it. Any suggestions?

Was it helpful?

Solution

Try

$("#slider").dateRangeSlider({
    range: {min: new Date(2012, 0, 1)}, //use minimum range
    bounds: {
           min: new Date(2012, 0, 1),
           max: new Date(2012, 11, 31, 12, 59, 59)
            },
    defaultValues: {
           min: new Date(2012, 1, 10),
           max: new Date(2012, 4, 22)
            }

      });

Fiddle http://jsfiddle.net/code_snips/Q4YKN/1/

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top