smalot / bootstrap-datetimepicker

Both Date and Time picker widget based on twitter bootstrap (supports Bootstrap v2 and v3)
http://www.malot.fr/bootstrap-datetimepicker/
Apache License 2.0
3.49k stars 1.65k forks source link

Selecting only working hours #734

Closed allentranks closed 5 years ago

allentranks commented 5 years ago

Hi there,

Is there a way to allow user to select only working hours? Let's say from 8:00am to 6:00pm, any other time slots in the day are disabled.

Thanks in advance.

Cheers

allentranks commented 5 years ago

I have checked out the source code and found there is a way to disable hours by specifying "hoursDisabled" in the options.

Issue closed.

            $('#ServiceTime').datetimepicker({
                format: 'dd M yyyy HH:ii P',
                minuteStep: 5,
                hoursDisabled: [0,1,2,3,4,5,21,22,23]
            });