I'm sort of in the process of learning javascript, and I've got a fair handle on it so far. Anyways, I built a page that has a date entry field, and I need a little calendar to pop up to choose dates from. The jquery UI datepicker (http://jqueryui.com/datepicker) looks really good, the only problem is that I know nothing about jquery. I can copy and paste the code in, but beyond that, I don't know very much. I need the calendar to choose a range of dates (like at http://jqueryui.com/datepicker/#date-range). I can use the source code there to put that in, but the problem is that I also need it to be in ISO 8601 format (like yyyy-mm-dd). The website says that to do that I use the following code:
$( ".selector" ).datepicker({ dateFormat: "yy-mm-dd" });
Ok, great, where do I put that? This is the source code from the website, where would I put it in there?
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>jQuery UI Datepicker - Select a Date Range</title>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
<link rel="stylesheet" href="/resources/demos/style.css" />
<script>
$(function() {
$( "#from" ).datepicker({
defaultDate: "+1w",
changeMonth: true,
numberOfMonths: 3,
onClose: function( selectedDate ) {
$( "#to" ).datepicker( "option", "minDate", selectedDate );
}
});
$( "#to" ).datepicker({
defaultDate: "+1w",
changeMonth: true,
numberOfMonths: 3,
onClose: function( selectedDate ) {
$( "#from" ).datepicker( "option", "maxDate", selectedDate );
}
});
});
</script>
</head>
<body>
<label for="from">From</label>
<input type="text" id="from" name="from" />
<label for="to">to</label>
<input type="text" id="to" name="to" />
</body>
</html>