Details
-
Task
-
Status: Closed
-
Should
-
Resolution: Fixed
-
None
-
None
-
Low
Description
Something like this:
function showCalendar(obj, yearsPrevious) { // if the object doesn't have an id, just set it to some random text so jq can use it if(!obj.id) { obj.id = "something_random" + (Math.random()*1000); } //set appendText to something so it doesn't automagically pop into the page var opts = { appendText: " " }; if (yearsPrevious && yearsPrevious>0) opts["yearRange"] = "-" + yearsPrevious + ":+0"; else opts["yearRange"] = "-0:+"+-1*yearsPrevious; alert(opts["yearRange"]); var dp = new DatePicker(jsDateFormat, obj.id, opts); jQuery.datepicker.setDefaults(jQuery.datepicker.regional[jsLocale]); obj.onclick = null; dp.show(); return false; }
(in this change you can send a negative number of previousYears to allow future years)
A better way to add another function that gets obj,previousYears,futureYears.