fixed regex to parse time and fixed timeOnly bug

master
Trent Richardson 2010-09-15 10:15:50 -04:00
parent 1dd304b2f9
commit c9ff8007fd
1 changed files with 8 additions and 5 deletions

View File

@ -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;
}
};
//########################################################################