Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

disable dates in jquery calendar between today's date and set date

I have to disable the dates between today's date to selected(set) date. Here is my code

$(function () {
    $("#departure").datepicker({
        dateFormat: "dd/mm/yy",
        changeMonth: true,
        changeYear: true,
        maxDate: "+5",
         minDate: -0
    });
    $("#departure").datepicker("setDate", "5");
});
<input id="departure" />

here is my screenshot:- enter image description here

Now I want to diable date 5 6 7 means 3 days after today. please help me.....

Hello I got my answer perfectly, But one issue came if in 5 days,if there is weekends it should be skip so what to do for that any body knows suppose today is 11-6-2013 then 15 and 16 should be skip and 19th date would come.

like image 622
User1988 Avatar asked Nov 12 '22 04:11

User1988


2 Answers

Here are few good links which can help you:-

http://articles.tutorboy.com/2010/09/03/jquery-ui-datepicker-disable-specified-dates/

http://tokenposts.blogspot.ca/2011/05/jquery-datepicker-disable-specific.html

http://davidwalsh.name/jquery-datepicker-disable-days

http://gauravganoo.com/tips/js/jquery-enable-disable-datepicker/

You can also use multidatespickr

like image 99
amrinder007 Avatar answered Nov 14 '22 22:11

amrinder007


This is my answer Today is 11-6-2013

 $("#departure").datepicker({
        dateFormat: "dd/mm/yy",
        changeMonth: true,
        changeYear: true,
        maxDate: "+1y",
         minDate: +4,
    });
 $("#departure").datepicker("setDate", "5");
<input id="departure" />

enter image description here

like image 28
User1988 Avatar answered Nov 14 '22 22:11

User1988