Okay, so if you take a date field and set it to default to the current date, and assign it a CSS Class of currentDate, then add the following to the CSS section:
.currentDate
{
display:none;
}
Then, Take your date field you want to limit to 90 days and add the CSS Class of SelectDate to it. Then add in the Javascript section the following:
$(function() {
$(document).ready(function () {
var currentDate = $('.currentDate input').val(); // Gets Current Date Information from Hidden Field
var dateSplit = [];
dateSplit = currentDate.split("/");
var newMonth = parseInt(dateSplit[0]) + 3; // Get Month + 3
var AddYear = 0; // Year Offset
if (newMonth > 12){ // Determine if not a valid month
newMonth -= 12; // Make newMonth valid
AddYear = 1; // Increment year offset
}
var newYear = parseInt(dateSplit[2]) + AddYear; // Calculate the Year
var maxDate = (newYear+"-"+newMonth+"-"+dateSplit[1]);
$('.SelectDate input').attr('max',maxDate);
});
});
This has been working for me in my tests. The only thing is this is an approximation. Instead of taking 90 days forward, it's just calculating 3 months into the future. That is not however to mean it is impossible to calculate to 90 days, but I felt that this would get you in the ballpark of what you wanted to accomplish.
You can make further modifications like making sure that you do not assign February an end date of 29 or 30 or 31 by adding some more stuff in at line 12