PitPik/tinyDatePicker

Add 'apply' button for time

Closed this issue · 1 comments

Is it possible to add an 'apply' button that inserts the time values in the timepicker into the input field? For instance if the input is blank and i have a readValue function that starts at the current time. The only want to apply that to the input is to change a value (hours, minutes or seconds) and change it back to the original value for it to get applied to the input field.

Not sure if this is the most elegant solution, but it works.

if (/apply/.test(className)) {
  $('#'+_this.currentInput.id).val(_this.date.hour+':'+_this.date.minute+':'+_this.date.second);
  _this.toggle();
}