Date Picker Using Jquery (Disabled Previous Date Than Current Date)

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>

<body>
<link href="http://code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css" rel="Stylesheet"
        type="text/css" />
    <script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
    <script type="text/javascript" src="http://code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
    <script language="javascript">
        $(document).ready(function () {
            $("#datepicker").datepicker({
                minDate: 0
            });
        });
    </script>
<script>
$("#datepicker" ).datepicker({  
    minDate: +1,
    beforeShow : function(){
        var dateTime = new Date();
        var hour = dateTime.getHours();
        if(hour  >= 11){
            $(this).datepicker( "option", "minDate", "+1" );
        }
    }
});
</script>

<input id="datepicker" type="text">
</body>
</html>
Previous
Next Post »