Skip to content

Commit

Permalink
Added separator to formatted time output
Browse files Browse the repository at this point in the history
  • Loading branch information
trentrichardson committed Dec 17, 2010
1 parent b4805d6 commit b394ee8
Showing 1 changed file with 5 additions and 14 deletions.
19 changes: 5 additions & 14 deletions jquery-ui-timepicker-addon.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* jQuery timepicker addon
* By: Trent Richardson [http://trentrichardson.com]
* Version 0.9.2-dev
* Last Modified: 12/13/2010 by Charles Phillips
* Last Modified: 12/17/2010
*
* Copyright 2010 Trent Richardson
* Dual licensed under the MIT and GPL licenses.
Expand Down Expand Up @@ -58,10 +58,8 @@ function Timepicker() {
hourMax: 23,
minuteMax: 59,
secondMax: 59,

minDateTime: null,
maxDateTime: null,

maxDateTime: null,
hourGrid: 0,
minuteGrid: 0,
secondGrid: 0,
Expand Down Expand Up @@ -185,7 +183,7 @@ $.extend(Timepicker.prototype, {
// the time should come after x number of characters and a space.
// x = at least the length of text specified by the date format
var dp_dateFormat = $.datepicker._get(this.inst, 'dateFormat');
regstr = '.{' + dp_dateFormat.length + ',}\\s*?' + regstr;
regstr = '.{' + dp_dateFormat.length + ',}\\s*' + regstr;
}

treg = timeString.match(new RegExp(regstr, 'i'));
Expand Down Expand Up @@ -598,7 +596,6 @@ $.extend(Timepicker.prototype, {
if (dp_inst.lastVal !== undefined && (dp_inst.lastVal.length > 0 && this.$input.val().length === 0))
return;

<<<<<<< HEAD
if (this._defaults.timeOnly === true) {
formattedDateTime = this.formattedTime;
if (this.$altInput) {
Expand All @@ -607,18 +604,12 @@ $.extend(Timepicker.prototype, {
} else if (this._defaults.timeOnly !== true && (this._defaults.alwaysSetTime || timeAvailable)) {
if (this.$altInput) {
if (this._defaults.timeOnly !== true) {
this.$altInput.val(this.$altInput.val() + ' ' + this.formattedTime);
this.$altInput.val(this.$altInput.val() + this._defaults.separator + this.formattedTime);
} else {
this.$altInput.val(this.formattedDateTime);
}
}
formattedDateTime += ' ' + this.formattedTime;
=======
if (this._defaults.timeOnly === true) formattedDateTime = this.formattedTime;
else if (this._defaults.timeOnly !== true && (this._defaults.alwaysSetTime || timeAvailable)) {
if (this.$altInput) this.$altInput.val(this.formattedTime);
else formattedDateTime += this._defaults.separator + this.formattedTime;
>>>>>>> michael-simons-master
formattedDateTime += this._defaults.separator + this.formattedTime;
}

this.formattedDateTime = formattedDateTime;
Expand Down

0 comments on commit b394ee8

Please sign in to comment.