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

altTimeFormat doesn't allow an empty value #706

Closed sporifolous closed 10 years ago

sporifolous commented 10 years ago

I think it would be advantageous to allow an empty string value for the 'altTimeFormat' option. This would allow putting just the date in the alt field and just the time in the regular field. Currently, if an empty string is passed for 'altTimeFormat', the time is still placed in the altField.

An easy fix: an else if on line 893:

else if (this._defaults.altTimeFormat !== ""){
    altFormattedDateTime += this.formattedTime + altTimeSuffix;
}

I hope this can be helpful.

ScottDennison commented 10 years ago

Note that the same problem applies to altSeparator and altTimeSuffix

trentrichardson commented 10 years ago

I updated the dev branch with a potential fix