I would like to add a \"Reset\" control to the datepicker at the bottom of the calendar - where the \"close\" control goes. This would enable the user to reset the input tie
Here is the scoop
We can use default done button to bind a custom clear function.
$("#date_picker").datepicker({minDate:myDate,dateFormat: 'yy-mm-dd',showButtonPanel:true,closeText:'Clear',
beforeShow: function( input ) {
setTimeout(function() {
var clearButton = $(input )
.datepicker( "widget" )
.find( ".ui-datepicker-close" );
clearButton.unbind("click").bind("click",function(){$.datepicker._clearDate( input );});
}, 1 );
}
});
Works like a charm. Cheers :);)
credits: Sébastien Renauld and BehranG BinA