Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

mindate from another datepicker

$("#<%=txtFromDate.ClientID%>").datepicker({
            changeMonth: true,
            changeYear: true,
            dateFormat: 'dd-M-yy',
            showOn: "button",
            buttonImage: "../Images/Calendar.png",
            buttonImageOnly: true,
            yearRange: '-20:+20',
            buttonText: "Date with abbreviated month name",
            onSelect: function (selected) {
                var dt = new Date(selected);
                dt.setDate(dt.getDate() + 1);
                $("#<%=txtToDate.ClientID%>").datepicker("option", "minDate", dt);
            }
        });

    

$("#<%=txtToDate.ClientID%>").datepicker({
            changeMonth: true,
            changeYear: true,
            dateFormat: 'dd-M-yy',
            showOn: "button",
            buttonImage: "../Images/Calendar.png",
            buttonImageOnly: true, 
            yearRange: '-20:+20',
            buttonText: "Date with abbreviated month name",
            onSelect: function (selected) {
                var dt = new Date(selected);
                dt.setDate(dt.getDate() - 1);
                $("#<%=txtFromDate.ClientID%>").datepicker("option", "maxDate", dt);
            }
        });
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #mindate #datepicker
ADD COMMENT
Topic
Name
8+7 =