Is there a way to have the calendar display 2 weeks from today's date?
I can get it so the date picker does not allow you to select anything less than today's date, however I would like it to limit the user to not be able to pick anything from 2 weeks from today's date.
$(function() {
$(document).ready(function () {
var todaysDate = new Date(); // Gets today's date
// Max date attribute is in "YYYY-MM-DD". Need to format today's date accordingly
var year = todaysDate.getFullYear(); // YYYY
var month = ("0" + (todaysDate.getMonth() + 1)).slice(-2); // MM
var day = ("0" + todaysDate.getDate()).slice(-2); // DD
var minDate = (year +"-"+ month +"-"+ day); // Results in "YYYY-MM-DD" for today's date
// Now to set the max date value for the calendar to be today's date
$('.calendarDate input').attr('min',minDate);
});
});
Any help is greatly appreciated.