Skip to content

Commit

Permalink
Item11020: Prevent javascript error if input field value is not a date.
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.foswiki.org/branches/Release01x01@12308 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
ArthurClemens authored and ArthurClemens committed Aug 13, 2011
1 parent aecec7b commit d93a510
Showing 1 changed file with 3 additions and 4 deletions.
Expand Up @@ -1235,6 +1235,9 @@ Calendar.prototype.setDateToolTipHandler = function (unaryFunction) {
* date is different than the currently selected one).
*/
Calendar.prototype.setDate = function (date) {
if (date === undefined || date === null || !(new Date(date))) {
return;
}
if (!date.equalsTo(this.date)) {
this._init(this.firstDayOfWeek, date);
}
Expand Down Expand Up @@ -1740,10 +1743,6 @@ Date.prototype.setDateOnly = function(date) {
this.setFullYear(tmp.getFullYear());
this.setMonth(tmp.getMonth());
this.setDate(tmp.getDate());
// keep existing time
this.setHours(date.getHours());
this.setMinutes(date.getMinutes());
this.setSeconds(date.getSeconds());
};

Date.prototype.setDateAndTime = function(date) {
Expand Down

0 comments on commit d93a510

Please sign in to comment.