var serverToday = new Date(2013, 3, 11);
$.datepicker.setDefaults({
showAnim: "fold",
showOn: "both",
showButtonPanel: true,
currentText: "Current Month",
closeText: "Close",
buttonText: "Choose a Date",
buttonImage: "/images/calendar_w25xh24.jpg",
buttonImageOnly: true,
defaultDate: "+1w",
changeMonth: true,
changeYear: true,
firstDay: 0 //Set the first day of the week: Sunday is 0, Monday is 1
});
$(function() {
$( "#datepicker" ).datepicker({
minDate: serverToday
});
});
$(function() {
$( "#from" ).datepicker({
maxDate: serverToday,
onClose: function( selectedDate ) {
$( "#to" ).datepicker( "option", "minDate", selectedDate );
}
});
$( "#to" ).datepicker({
maxDate: serverToday,
onClose: function( selectedDate ) {
$( "#from" ).datepicker( "option", "maxDate", selectedDate );
}
});
});
<p >Date: <input type="text" id="datepicker" /></p>
<p><label for="from">From:</label><input type="text" id="from" name="from" />
<label for="to" style="margin-left:20px;">To:</label><input type="text" id="to" name="to" /></p>
<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.2/themes/smoothness/jquery-ui.min.css" rel="stylesheet" />
<style type="text/css">
.ui-datepicker-trigger{
display:inline;
margin:0px;
border:0px solid red;
padding:0px;
margin:0px;
vertical-align:bottom;
position:relative;
}
div#ui-datepicker-div .ui-datepicker-current-day {
background-color: #cd0a0a;
}
div#ui-datepicker-div{
font-family: Tahoma, Verdana, sans-serif; font-size: 14px;
border: 3px double #566483;
}
.ui-datepicker .ui-datepicker-buttonpane button {
float: right;
margin: .5em .2em .4em;
cursor: pointer;
padding: .2em .6em .3em .6em;
width: auto;
overflow: visible;
color:#566483;
font-size: 12px;
}
.ui-datepicker .ui-datepicker-buttonpane .ui-datepicker-close {
font-weight:400;
}
.ui-datepicker .ui-datepicker-buttonpane .ui-datepicker-current {
font-weight:900;
}
.ui-datepicker-calendar thead, .ui-datepicker-calendar th {
text-align: center;
background: #566483;
color: #FFFFFF;
font-weight: bold;
border: 1px solid #CCCCCC;
}
.ui-datepicker-calendar tbody {
border: 1px solid #CCCCCC;
}
</style>
External resources loaded into this fiddle: