I also searched high and low, but after entering a few debugging messages, the answer was obvious. I noticed that the onClose method has a "value" parameter that has the actual date that you select OR, if you did not select anything, it has the original value from your text box. Set it as the value of the input field and walaaaa! the problem is resolved.
If you do not, the current date will replace the original date when you just want to close the datetimepicker.
$('input.datetime').datetimepicker({ ampm: true, timeFormat: 'hh:mm tt', addSliderAccess: true, sliderAccessArgs: { touchonly: false }, onClose: function (value) { $('input.datetime').val(value); } });
source share