I'm trying to use Timepicker of materializecss. I need to use the onSelect event but nothing happens.
This is the html :
<input type="text" name="time" class="timepicker">
This is the javascript :
$(document).ready(function(){
$('.timepicker').timepicker({
onSelect:function(hour,minute){
alert(hour+" "+minute);
}
});
});
The timepicker is working very well but when I select time and hour, nothing happens. No error in console and no alert shown... I tried with the onCloseEnd event but nothing happens too.
I need help !
Seems the documentation is wrong. I checked the
materialize.jsand found thattimepickerdidn't bind any event such asonOpenStart,onSelectandonCloseEndbut datepicker did.This snippet shows that the same event but only binding to datepicker.
Here's a demo, showing that none of the events mentioned in the documentation are triggered (They even didn't be registered cause there is no
eventoptions in timepicker.)timepicker

datepicker
The only way success is using
change()event.