diff options
author | Trent Richardson <trentdrichardson@gmail.com> | 2010-09-15 10:15:50 -0400 |
---|---|---|
committer | Trent Richardson <trentdrichardson@gmail.com> | 2010-09-15 10:15:50 -0400 |
commit | c9ff8007fd6c4433b92fdec637446a263f629635 (patch) | |
tree | 4a0ea48aa3b30c3e93800df6e119248e733fd3b9 /jquery-ui-timepicker-addon.js | |
parent | 1dd304b2f9599832a35b852587c1bc84c95d249a (diff) | |
download | jQuery-Timepicker-Addon-c9ff8007fd6c4433b92fdec637446a263f629635.zip jQuery-Timepicker-Addon-c9ff8007fd6c4433b92fdec637446a263f629635.tar.gz jQuery-Timepicker-Addon-c9ff8007fd6c4433b92fdec637446a263f629635.tar.bz2 |
fixed regex to parse time and fixed timeOnly bug
Diffstat (limited to 'jquery-ui-timepicker-addon.js')
-rwxr-xr-x | jquery-ui-timepicker-addon.js | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/jquery-ui-timepicker-addon.js b/jquery-ui-timepicker-addon.js index 931a452..14550a4 100755 --- a/jquery-ui-timepicker-addon.js +++ b/jquery-ui-timepicker-addon.js @@ -76,7 +76,7 @@ if (!this.defaults.timeOnly) { //the time should come after x number of characters and a space. x = at least the length of text specified by the date format - regstr = '.{' + this.defaults.timeFormat.length + ',}\\s+' + regstr; + regstr = '.{' + this.defaults.dateFormat.length + ',}\\s+' + regstr; } var order = this.getFormatPositions(); @@ -306,7 +306,10 @@ var formattedDateTime = this.formattedDate; var timeAvailable = dt !== null && tp_inst.timeDefined; - if (this.defaults.timeOnly !== true && (this.defaults.alwaysSetTime || timeAvailable)) { + if(this.defaults.timeOnly === true){ + formattedDateTime = this.formattedTime; + } + else if (this.defaults.timeOnly !== true && (this.defaults.alwaysSetTime || timeAvailable)) { formattedDateTime += ' ' + this.formattedTime; } @@ -315,9 +318,9 @@ }, setDefaults: function(settings) { - extendRemove(this.defaults, settings || {}); - return this; - } + extendRemove(this.defaults, settings || {}); + return this; + } }; //######################################################################## |