aboutsummaryrefslogtreecommitdiffstats
path: root/ui/ui.datepicker.js
diff options
context:
space:
mode:
authorKeith Wood <kbwood.au@gmail.com>2008-08-21 09:25:20 +0000
committerKeith Wood <kbwood.au@gmail.com>2008-08-21 09:25:20 +0000
commitc5635d6350a64ed62b5770b5a46eb5623c34fc9d (patch)
treea5b962184e01e4f52e594113046a493ff9e4f028 /ui/ui.datepicker.js
parent426c5e1fc7d4599a15457138d1f93a8f55c7caf3 (diff)
downloadjquery-ui-c5635d6350a64ed62b5770b5a46eb5623c34fc9d.tar.gz
jquery-ui-c5635d6350a64ed62b5770b5a46eb5623c34fc9d.zip
Fixed 3191 NaN causes breakage for relative dates
Diffstat (limited to 'ui/ui.datepicker.js')
-rw-r--r--ui/ui.datepicker.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/ui/ui.datepicker.js b/ui/ui.datepicker.js
index d4b01a208..6c476d9f7 100644
--- a/ui/ui.datepicker.js
+++ b/ui/ui.datepicker.js
@@ -1244,9 +1244,10 @@ $.extend(Datepicker.prototype, {
}
return new Date(year, month, day);
};
- return (date == null ? defaultDate :
+ date = (date == null ? defaultDate :
(typeof date == 'string' ? offsetString(date, this._getDaysInMonth) :
- (typeof date == 'number' ? offsetNumeric(date) : date)));
+ (typeof date == 'number' ? (isNaN(date) ? defaultDate : offsetNumeric(date)) : date)));
+ return (date && date.toString() == 'Invalid Date' ? defaultDate : date);
},
/* Set the date(s) directly. */