My real name My real name - 24 days ago 8
jQuery Question

How to disable "tomorrow only" on jquery date picker?

Hello im new with this jquery datepicker. I need to disabled tomorrow in jquery datepicker. Here is the following js script :

$(function() {
$("#iDate").datepicker();
});


it just a normal jquery datepicker script without any option. Here is the fiddle

Answer Source

Here you go with a solution http://jsfiddle.net/JjPrU/1392/

$(function() {
  var d = new Date();
  var unavailableDate = (d.getDate() + 1) + "-" + (d.getMonth() + 1) + "-" + d.getFullYear();
  var unavailableDates = [];
  unavailableDates.push(unavailableDate);

  function unavailable(date) {
    dmy = date.getDate() + "-" + (date.getMonth() + 1) + "-" + date.getFullYear();
    if ($.inArray(dmy, unavailableDates) == -1) {
        return [true, ""];
    } else {
        return [false, "", "Unavailable"];
    }
  }

  $(function() {
    $("#iDate").datepicker({
        dateFormat: 'dd MM yy',
        beforeShowDay: unavailable
    });
  });
});
<link href="https://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.17/themes/black-tie/jquery-ui.css" rel="stylesheet"/>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script src="https://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.17/jquery-ui.min.js"></script>
<input id="iDate">

Hope this will help you.