I am new in jquery. I want to remove todays button from datepicker in Jquery. How to do that? I am using Jquery ui 1.8.10.
Regards, Girish
use this style in your css file
button.ui-datepicker-current { display: none; }
I have this:
$(".datepicker").datepicker({
dateFormat: "yy-mm-dd",
changeMonth: true,
changeYear: true,
yearRange: "c-150:c+30",
showButtonPanel:true,
closeText:'Clear',
beforeShow: function( input ) {
setTimeout(function () {
$(input).datepicker("widget").find(".ui-datepicker-current").hide();
var clearButton = $(input ).datepicker( "widget" ).find( ".ui-datepicker-close" );
clearButton.unbind("click").bind("click",function(){$.datepicker._clearDate( input );});
}, 1 );
}
}).attr("readonly", true);
the line :
$(input).datepicker("widget").find(".ui-datepicker-current").hide();
hide the today button
Read more on docs.jquery.com
$(document).ready(function() {
$("#datepicker").datepicker({
"showButtonPanel": false
});
});
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.9/themes/base/jquery-ui.css" type="text/css" media="all" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.9/jquery-ui.min.js" type="text/javascript"></script>
<input type="text" id="datepicker"/>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With