Reputation: 33
I have a problem to set the S2 jQuery datepicker to a range between 1st of March 2012 and 31st of March 2014. I have an application that searches past data within this date range and cannot use the +/- setting based on the todays date. I tried to pass a Date object from Action class, but I don't know if it's possible to access it inside the tag. I would appreciate your help!
<sj:datepicker value="Start" id="start"
name="startDate"
changeMonth="false"
changeYear="false"
showButtonPanel="false"
displayFormat="dd-mm-yy"
buttonImageOnly="true"
onfocus="checkByDate()"
minDate="????"
maxDate="????"
showOn="both"
/>
Upvotes: 3
Views: 1220
Reputation: 50271
In JSP:
<sj:datepicker
....
minDate="%{minDate}"
maxDate="%{maxDate}"
/>
In Action class:
public java.util.Date getMinDate(){
return minDate;
}
public java.util.Date getMaxDate(){
return maxDate;
}
Upvotes: 1