user6589133
user6589133

Reputation:

Bootstrap datetimepicker does not firing change event on time change

I am using only time input (Custom Formats example 3 given on this link) http://eonasdan.github.io/bootstrap-datetimepicker/

I only wants to listen for change in time when user click up or down for hour or minute changes. I tried change.dp, change and dp.change but none are working

<div class='input-group date' id='datetimepicker3'>
  <input type='text' class="form-control" id="start_time"/>
  <input type="hidden" name="book_meeting[start_date]" id="book_meeting_start_date" />
  <span class="input-group-addon">
    <span class="glyphicon glyphicon-time"></span>
  </span>
</div>
$("#start_time").on("change", function(e) {
  alert("helloi");
});

$("#book_meeting_start_date").on("change", function(e) {
  alert("helloi");
});

$("#book_meeting_start_date").on("change.dp", function(e) {
  alert("helloi");
});

Upvotes: 0

Views: 1365

Answers (1)

user6589133
user6589133

Reputation:

After searching i found it's answer.i ended up using dp.hide which is working as expected.

 $('#datetimepicker3').datetimepicker({
    stepping: 5,
    format: 'HH:mm'
}).on('dp.hide', function (event) {

});

Upvotes: 1

Related Questions