datepicker: changed yearRange to be relative to current year instead of selected year (fixes #2627)

This commit is contained in:
Marc Grabanski 2008-06-01 20:04:19 +00:00
parent 0a2cc194d5
commit dce035cc65
2 changed files with 3 additions and 3 deletions

View File

@ -1,6 +1,6 @@
<html>
<head>
<html>Only core files for easy debug</html>
<title>Only core files for easy debug</title>
<link rel="stylesheet" href="../../../themes/ui.datepicker.css" type="text/css" media="screen" title="default" charset="utf-8">
</head>
<body>

View File

@ -1290,8 +1290,8 @@ $.extend(DatepickerInstance.prototype, {
year = drawYear - 10;
endYear = drawYear + 10;
} else if (years[0].charAt(0) == '+' || years[0].charAt(0) == '-') {
year = drawYear + parseInt(years[0], 10);
endYear = drawYear + parseInt(years[1], 10);
year = new Date().getFullYear() + parseInt(years[0], 10);
endYear = new Date().getFullYear() + parseInt(years[1], 10);
} else {
year = parseInt(years[0], 10);
endYear = parseInt(years[1], 10);