jQRangeSlider icon indicating copy to clipboard operation
jQRangeSlider copied to clipboard

DateRangeSlider : bounds unreachable if difference < step

Open nicofrand opened this issue 12 years ago • 11 comments

If the distance/difference between the max bound and the max value is lower than a step, then the bar can not be dragged or resized until the bound is reached.

Here is a test case : http://jsfiddle.net/vM844/318/. The step is a month but the difference between the max bound and the max value is only of a few days. (I used months here but the issue remains with days as steps and only a fews hours as distance).

I quickly tried with a simple slider (not a dateRangeSlider) and there was no issue.

nicofrand avatar Apr 18 '13 09:04 nicofrand

Hi,

In your case, is it a valid range to have both min and max values identical?

ghusse avatar Apr 18 '13 09:04 ghusse

No it is not.

nicofrand avatar Apr 18 '13 10:04 nicofrand

Edited : see https://github.com/ghusse/jQRangeSlider/issues/112

nicofrand avatar Apr 18 '13 12:04 nicofrand

As they're not valid, consider using this option: http://ghusse.github.io/jQRangeSlider/documentation.html#rangeOption

In order to set the minimum possible range.

ghusse avatar Apr 18 '13 12:04 ghusse

I do not get it : why are they invalid ? The min and max values here are different… Do you mean that, for the range option, I MUST set an object, and do not rely on the default values ? ({min: false, max: false}) ?

nicofrand avatar Apr 18 '13 12:04 nicofrand

It was a question about your precise case. I wanted to know if this option will do the job for you.

ghusse avatar Apr 18 '13 12:04 ghusse

Do you want something like that, where people cannot select both min and max values as the same values:

http://jsfiddle.net/ghusse/R8DnC/

ghusse avatar Apr 18 '13 12:04 ghusse

Yes, this is fine. But I definitely do not see the relation. When I said :

the max bound and the max value

I was speaking of the max value from the bounds object, returned by dateRangeSlider("bounds").max and the max value from the values object, returned by dateRangeSlider("values").max. It means that I should be able to stick the blue bar (the range bar) to the maximum bound like this : bug-rangeSlider

Am I clear enough ?

nicofrand avatar Apr 18 '13 12:04 nicofrand

Woops, ok, sorry. I was confusing 2 issues.

I don't see in your example why you'd be able to do this: you cannot have a step of 1 month and a max bound that is not a multiple of your step.

In fact, you can, but I don't see then why you'd like people to be able to select this value.

ghusse avatar Apr 18 '13 13:04 ghusse

As I see it, the step is just something more practical but that does not mean that I should not be able to select an uncomplete month. Let's say I want to select from a given month until today (as I say it, we are the 19th april, so the month is not finished).

Having steps is really practical in order to move the range but that should not act as boundaries.

nicofrand avatar Apr 18 '13 13:04 nicofrand

Steps actually act like that: you cannot select a value not included in steps.

ghusse avatar Apr 18 '13 13:04 ghusse