Hi I need to implement a slider for 24 hour time range . I like to use jquery ui slider for this . I have written below code
<script type="text/javascript">
$(function() {
$(".slider-range").slider({
range: true,
min: 0,
max: 23.59,
step: 0.15
});
});
</script>
I like the range is like 01:00----01:59
How i gave the colon(:) instead of dot(.) . Also the range waas gone beyond 59 like 05:85 . Please help me to create a time slider
Do not use hours as a unit, use minutes instead. Then apply a
slide
event that converts the minutes to hours:It should just be hours2 < 10 and minutes2 < 10, not hours2.length < 10 and minutes2.length < 10. This is evaluation of numeric value not string length.
Improving on Tatu's answer, to get the time range in "civilian time," with a 12 hour clock and AM and PM designations. Here is a JSFIDDLE
*Update - I changed the code slightly so that the min value displays as "12:00 AM" and the max value displays as "11:59 PM." The fiddle is also updated...
Here is my 24 hours version based on both of the answers for input fields
Javascript
HTML
Here an example:
upplex - webdesign