Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jquery Timepicker disabletimerange

I'm using jquery timepicker and timepicker version is 1.3.x. but, in this version disable time range is not working. So i need to know the bug where i did. please find following code for your reference

$('#totimeofappointment').attr("placeholder", "To hh:mm").timepicker({
            timeFormat: 'h:mm p',
            interval: 15,
            minTime: '10:00',
            maxTime: '5:00pm',
            maxMinutes: 45,
            startTime: '10:00',
            dynamic: false,
            dropdown: true,
            scrollbar: true,
            disableTimeRanges: [ ['1:30pm', '2:30pm'], ['3pm', '4:01pm'] ]
            change: function (time) {
              }
});

I need to restrict the time range from 1:30pm to 2:30pm

like image 638
sugu don Avatar asked Jun 21 '26 00:06

sugu don


1 Answers

It seems you are missing a comma (,) just after your timeRanges code:

$('#totimeofappointment').attr("placeholder", "To hh:mm").timepicker({
            interval: 15,
            minTime: '10:00am',
            maxTime: '5:00pm',
            maxMinutes: 45,
            startTime: '10:00am',
            dynamic: false,
            dropdown: true,
            scrollbar: true,
            disableTimeRanges: [ ['1:30pm', '2:30pm'], ['3pm', '4:01pm'] ],
            change: function (time) {
            }
});
like image 132
fmsthird Avatar answered Jun 23 '26 03:06

fmsthird