<!DOCTYPE html> <title> <div>Please Select Dates:</div> <p>Start Date:</p> <p>End Date:</p> $(document).ready(function() { var minDate; var maxDate; var mDate var j = jQuery.noConflict(); j("#startTime").datepicker({ onSelect: function() { minDate = j("#startTime").datepicker("getDate"); var mDate = new Date(minDate.setDate(minDate.getDate())); maxDate = new Date(minDate.setDate(minDate.getDate() + 4)); j("#endTime").datepicker("setDate", maxDate); j("#endTime").datepicker("option", "minDate", mDate); j("#endTime").datepicker("option", "maxDate", maxDate); } }); var tdate = new Date(); var ddate = new Date(tdate.setDate(tdate.getDate() + 4)); j("#startTime").datepicker("setDate", new Date()); j("#endTime").datepicker(); j("#endTime").datepicker("setDate", ddate); }); What I have tried: i tried to search it up but i can't achieve the desired output
$(function(){ /* suppose you are trying to disable sunday(0 index),and saturday(6 index) */ $('#yourDatePickerId').datepicker({ daysOfWeekDisabled: [0,6] }); });
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)