diff options
author | David Petersen <public@petersendidit.com> | 2013-01-23 11:50:00 -0800 |
---|---|---|
committer | David Petersen <public@petersendidit.com> | 2013-01-23 11:50:00 -0800 |
commit | f7f165c9f8281c5fc5d060eb7bfe09921a0aea82 (patch) | |
tree | 69538b346edec352b07bd123ea2e023eb6749a0c /ui | |
parent | 10c873ab6cf2333f7e51784e84c03a0fbb975e1f (diff) | |
parent | 8f7c3e309cae07c75b930c55f14c05053d5028e9 (diff) | |
download | jquery-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.js | 10 |
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()) && |