aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorDavid Petersen <public@petersendidit.com>2013-01-23 11:50:00 -0800
committerDavid Petersen <public@petersendidit.com>2013-01-23 11:50:00 -0800
commitf7f165c9f8281c5fc5d060eb7bfe09921a0aea82 (patch)
tree69538b346edec352b07bd123ea2e023eb6749a0c /ui
parent10c873ab6cf2333f7e51784e84c03a0fbb975e1f (diff)
parent8f7c3e309cae07c75b930c55f14c05053d5028e9 (diff)
downloadjquery-ui-f7f165c9f8281c5fc5d060eb7bfe09921a0aea82.tar.gz
jquery-ui-f7f165c9f8281c5fc5d060eb7bfe09921a0aea82.zip
Merge pull request #891 from petersendidit/datepicker_8994
Datepicker: Handle when yearRange is a year or a modifier. Fixed #8994 -...
Diffstat (limited to 'ui')
-rw-r--r--ui/jquery.ui.datepicker.js10
1 files changed, 8 insertions, 2 deletions
diff --git a/ui/jquery.ui.datepicker.js b/ui/jquery.ui.datepicker.js
index 24f0d5405..e93f596fc 100644
--- a/ui/jquery.ui.datepicker.js
+++ b/ui/jquery.ui.datepicker.js
@@ -1918,8 +1918,14 @@ $.extend(Datepicker.prototype, {
if (years){
yearSplit = years.split(":");
currentYear = new Date().getFullYear();
- minYear = parseInt(yearSplit[0], 10) + currentYear;
- maxYear = parseInt(yearSplit[1], 10) + currentYear;
+ minYear = parseInt(yearSplit[0], 10);
+ maxYear = parseInt(yearSplit[1], 10);
+ if ( yearSplit[0].match(/[+\-].*/) ) {
+ minYear += currentYear;
+ }
+ if ( yearSplit[1].match(/[+\-].*/) ) {
+ maxYear += currentYear;
+ }
}
return ((!minDate || date.getTime() >= minDate.getTime()) &&