I have a datepicker, and I need to be able to enter a date manually in multiple different formats. For example, for May 7, 2015, I need to be able to enter:
05/07/2015 05072015 050715 5715
I understand how to format all these above based off of the the jquery docs, but I cannot figure out how to make the input box take multiple different dates. I can change the format to any one of these individually, which will allow me to type in that specific format, but I can only do this once by defining the "dateFormat".
I found another page where the same problem seems to have been answered, but after many attempts, I cannot figure out how to fit it into my code successfully, here is the link to this page:
Datepicker and allowing multiple input formats
How do I fit that solution into the following code:
<h3>Date Selection</h3>
<label for="from">From</label>
<input type="text" id="from" name="from" />
<input type="text" id="altdate" />
<label for="to">to</label>
<input type="text" id="to" name="to" />
<script>
$(function() {
$( "#from" ).datepicker({
defaultDate: "+1w",
changeMonth: true,
numberOfMonths: 2,
onClose: function( selectedDate ) {
$( "#to" ).datepicker( "option", "minDate", selectedDate );
}
});
$( "#to" ).datepicker({
defaultDate: "+1w",
changeMonth: true,
numberOfMonths: 2,
onClose: function( selectedDate ) {
$( "#from" ).datepicker( "option", "maxDate", selectedDate );
}
});
});
</script>
I have been stuck on this for days, any help is greatly appreciated!!