trentrichardson / jQuery-Timepicker-Addon

Adds a timepicker to jQueryUI Datepicker
http://trentrichardson.com/examples/timepicker/
MIT License
2.66k stars 1.05k forks source link

"Change" event being fired even if the value has not changed #933

Closed melloware closed 8 months ago

melloware commented 6 years ago

Currently in "_updateDateTime" method the change event is fired but not checking whether the value actually changed.

See: https://github.com/primefaces/primefaces/issues/2811

I would change to...

_updateDateTime: function (dp_inst) {
   ...
   var originalValue = dp_inst.lastVal;
   if (originalValue === "") {
   ...
   if (originalValue != formattedDateTime) {
      this.$input.trigger("change"); 
   }