Anyone know how to disable the previous days from current day, in jsCalendar?
Also, how do you set the date rage to start from the current time to current time + 90 days?
I do not want to hard code the date ranges, but dynamically change them. So the start_date would be:current day and end_date would be: current day + 90 days.
You're going to have to provide more detail. There's more than one "jsCalendar" and we'll need a URL or some code or an image or something that helps us figure out what you're trying to do.
<script type="text/javascript">
function AddMonths() {
var todayInMS = today.getTime()
var Future3MonthsInMS = todayInMS + (60 * 60 * 24 * (7 * 4 * 3) * 1000)
return new Date(Future3MonthsInMS)
}
function dateStatus(date) {
var min = new Date();
var max = AddMonths();
if (date.getTime() < min.getTime() ||
date.getTime() > max.getTime())
return true; // true says "disable"
else
return false; // leave other dates enabled
}
It looks to me like you're on the right track. After a (brief) look at the provided docs and examples, the dateStatusFunc property allows you to tell the program what dates to disable.
The only "range" feature provided by the calendar is a Year range as opposed to a specific number of days. You'll have to prototype whatever part of the object checks for the range and modify it yourself.
Bookmarks