Jquery Timepicker disabletimerange

Asked by At

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

1 Answers

0
fmsthird On

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) {
            }
});