I am trying to customize this script so that so that onclick #startdatepicker would show this Sunday’s date in yy-mm-dd format and #enddatepicker would show next sat. date by default.
<script type="text/javascript">
$(document).ready(function() {
$("#startdatepicker").datepicker({
dateFormat: 'yy-mm-dd'
});
$("#enddatepicker").datepicker({
dateFormat: 'yy-mm-dd',
});
});
</script>
Start Date: <input type="text" id="startdatepicker"/><br />
End Date: <input type="text" id="enddatepicker"/><br />`
If you always want the datePicker to default to the next Sunday (regardless of today’s date), try:
The same can be done to find the following Saturday, just add 6 more days.
http://jsfiddle.net/dYEMn/3