escist
escist

Reputation: 773

JQuery UI Datepicker - How to remove the "Done" button

I am using a Jquery datepicker. I want the button panel to be visible, but I do not want the "Done" button. According to the Jquery UI page here

Display a button for selecting Today's date and a Done button for closing the calendar with the boolean showButtonPanel option. Each button is enabled by default when the bar is displayed, but can be turned off with additional options.

What are the options for turning off the Done button? My code:

<script>
 $(function() {
  $( "#JourneyDate" ).datepicker({
        showButtonPanel: true,
        showWeek: true,
        maxDate: "+0",
        dateFormat: 'd MM yy',
        changeMonth: true,
        changeYear: true
    });
});
</script>

I tried accessing the button using selector ui-datepicker-close and calling remove() but that does not seem to work.

Upvotes: 8

Views: 10217

Answers (2)

BehranG BinA
BehranG BinA

Reputation: 512

$('<style type="text/css"> .ui-datepicker-close { display: none; } </style>').appendTo("head");

Upvotes: 1

Alex K.
Alex K.

Reputation: 175896

You can do it with CSS;

button.ui-datepicker-close {display: none;}​

Upvotes: 19

Related Questions