jquery-date-range-picker icon indicating copy to clipboard operation
jquery-date-range-picker copied to clipboard

Add time picker configuration (min, max, step, enabled/disabled)

Open khasali opened this issue 11 years ago • 2 comments

Currently, the timeselector handle moves in 1min intervals.Would it be possible to allow configure this or use a 15min default. It's not easy to move the handle to exactly 3.00 PM, for instance.

khasali avatar Dec 16 '14 03:12 khasali

:+1:

Indeed, currently when enabling time selection, a range slider is rendered by the 'getTimeHTML()' function. However the attributes of the range sliders can not be configured. It would be nice when this is possible using the time configuration object:

{
    time: {
        enabled: true
        hourRange: {
            enabled: true, //Only allow 09:00, 13:00 and 17:00
            min: 9,
            max: 17,
            step: 4
        }
        minuteRange{
            enabled: false //Do not display the minuteRange
        }
    }
}

Additionally it would be nice to expose some of the time related function to have some more control over the time sliders:

$('.dateRangePicker').data('dateRangePicker').setTime('time1', 0, 0);

The way it currently has to be done is not really elegant:

"$('.hour input[type=range]').attr('min', 9).attr('max', 21).attr('step', 4);
"$('.minute input[type=range]').val(0).change(); //Reset the minutes and trigger a change event to apply the value
"$('.minute').hide(); //Hide all the minute related information

holtkamp avatar Jul 22 '15 11:07 holtkamp

This seems to be fixed in https://github.com/suluke/jquery-date-range-picker/commit/5fccea9eab268e485ace3c9e19523ff06b13a859, but there was no PR opened. I'm keeping this issue open and will see if we can use the provided solution in the current version of the library.

monovertex avatar Sep 19 '18 19:09 monovertex