summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTrent Richardson <trentdrichardson@gmail.com>2013-05-01 16:06:29 -0400
committerTrent Richardson <trentdrichardson@gmail.com>2013-05-01 16:06:29 -0400
commitba22e24a92c1207c63316627eaa1d7e2be5114dc (patch)
tree74727451c368b94f2c1d78696f403f558569d79b
parent3cf20b31e93cf7d5fc4f628366dc2875029b24ae (diff)
downloadjQuery-Timepicker-Addon-ba22e24a92c1207c63316627eaa1d7e2be5114dc.zip
jQuery-Timepicker-Addon-ba22e24a92c1207c63316627eaa1d7e2be5114dc.tar.gz
jQuery-Timepicker-Addon-ba22e24a92c1207c63316627eaa1d7e2be5114dc.tar.bz2
#583 altField not honoring timeOnly=true
-rw-r--r--jquery-ui-timepicker-addon.js22
1 files changed, 12 insertions, 10 deletions
diff --git a/jquery-ui-timepicker-addon.js b/jquery-ui-timepicker-addon.js
index 5bbb0fd..56ad172 100644
--- a/jquery-ui-timepicker-addon.js
+++ b/jquery-ui-timepicker-addon.js
@@ -857,7 +857,7 @@
if (!this._defaults.showTimepicker) {
this.$input.val(this.formattedDate);
- } else if (this.$altInput && this._defaults.altFieldTimeOnly === true) {
+ } else if (this.$altInput && this._defaults.timeOnly === false && this._defaults.altFieldTimeOnly === true) {
this.$altInput.val(this.formattedTime);
this.$input.val(this.formattedDate);
} else if (this.$altInput) {
@@ -865,16 +865,18 @@
var altFormattedDateTime = '',
altSeparator = this._defaults.altSeparator ? this._defaults.altSeparator : this._defaults.separator,
altTimeSuffix = this._defaults.altTimeSuffix ? this._defaults.altTimeSuffix : this._defaults.timeSuffix;
+
+ if(!this._defaults.timeOnly){
+ if (this._defaults.altFormat){
+ altFormattedDateTime = $.datepicker.formatDate(this._defaults.altFormat, (dt === null ? new Date() : dt), formatCfg);
+ }
+ else{
+ altFormattedDateTime = this.formattedDate;
+ }
- if (this._defaults.altFormat){
- altFormattedDateTime = $.datepicker.formatDate(this._defaults.altFormat, (dt === null ? new Date() : dt), formatCfg);
- }
- else{
- altFormattedDateTime = this.formattedDate;
- }
-
- if (altFormattedDateTime){
- altFormattedDateTime += altSeparator;
+ if (altFormattedDateTime){
+ altFormattedDateTime += altSeparator;
+ }
}
if(this._defaults.altTimeFormat){