0

I am using the Jquery clockpicker (https://github.com/weareoutman/clockpicker). Is there a way that you don't have to push the "Done" button to get the new time in the input field?

I have tried jQuery Clockpicker afterHourSelect but when I log out the hours and minutes, they are both undefined

Community
  • 1
  • 1
Joshmon27
  • 11
  • 3

1 Answers1

0

You need to set data-autoclose="true" and clock picker will close as soon as you select time.

<div class="input-group clockpicker" data-placement="left" data-align="top" data-autoclose="true">
    <input type="text" class="form-control" value="13:14">
    <span class="input-group-addon">
        <span class="glyphicon glyphicon-time"></span>
    </span>
</div>

Or you can initialize something like this in javascript:

var input = $('#single-input').clockpicker({
    placement: 'bottom',
    align: 'left',
    autoclose: true,
    'default': 'now'
});

For more documentation you can refer here

Saurabh Sharma
  • 2,422
  • 4
  • 20
  • 41