0

I am using clock-style time picker plugin.In that i need to restrict the time, to show AM or PM and also want to add button image to that field.

Here is the code which i have added in my js file:

              var input = $('#field');
                input.clockpicker({
                    autoclose: true
                });

             $('#field').clockpicker({
                    placement: 'bottom',
                    align: 'left',
                    donetext: 'Done',
              });

1 Answers1

0

When you are initialising your timepicker then only you have to set the mi time and max time as

var input = $('#single-input').clockpicker({
   twelvehour: 'true',
});

You can use afterDone or beforeDone method to validate the selected time. You can refrence here and here also

RAUSHAN KUMAR
  • 5,846
  • 4
  • 34
  • 70
  • The twelve hour format working fine.still i didnt get solution for min time maxtime. –  Feb 20 '17 at 07:29
  • That you should validate from your own like `'default': 'now'` and `afterDone: function() {$('this).val() > 'now'}` – RAUSHAN KUMAR Feb 20 '17 at 07:33
  • 1
    you can also check here http://stackoverflow.com/questions/35391567/how-to-prevent-jquery-bootstrap-clockpicker-to-get-minutes-that-are-not-divisibl – RAUSHAN KUMAR Feb 20 '17 at 07:34