ericjgagnon / wickedpicker

A simple jQuery timepicker
http://ericjgagnon.github.io/wickedpicker/
MIT License
93 stars 78 forks source link

Set default time #32

Open santoshjagade opened 8 years ago

santoshjagade commented 8 years ago

I currently using wickedpicker. I need to set the default time to two wickedpicker control when a user perform the button click operation. The timepickers.wickedpicker('time', 1) returns the time, but it wont provide any method to set the time.

Could you please tell me, how I can achieve the same?

justcurious commented 7 years ago

There's is no simple way to set the time after initialisation. I've altered the latest version (v0.4.1) to provide this functionality.

var myPicker = $('.timepicker').wickedpicker(options);

// set time to 2pm
myPicker.wickedpicker('setTime', 0, "14:00"); // 0 is the index of the timepicker. Use 0 if only one is present

Code can be found here: https://stackoverflow.com/a/45367908/1544886