How to disable specific Dates in Bootstrap Datepicker

jquery , Bootstrap




Hi Dev,

In this blog we will see how we can disable some dates in a jQuery can disable specific dates with array in bootstrap datepicker.

it will useing beforeShowDay options to disable Specific days in bootstrap datepicker.It is easy and simple method for disable dates on datepicker.most of situation in many dates disable then you can use that example.

we are disabled Bootstrap Datepicker in particular dates enable using beforeShowDay.


<!DOCTYPE html>




<link rel="stylesheet" type="text/css" href="">

<link rel="stylesheet" type="text/css" href="">

<script src = ""></script>

<script type="text/javascript" src=""></script>

<script src="" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>



<div class="container">

<div class="row">

<div class="col-md-6 offset-md-3 mt-5">

<div class="card">

<div class="card-header bg-info text-center">

<h4><b class="text-white">Date Picker</b></h4>


<div class="card-body">

<form action="" method="post">

<div class="row">

<div class="col-md-12">

<div class="form-group">


<input type="text" name="date" value="{{old('date')}}" class="datepicker form-control" autocomplete="off">




<div class="row">

<div class="col-md-12 text-center">

<button class="btn btn-success btn-sm" type="submit">Save</button>









<script type="text/javascript">

var disableDates = ["9-11-2019", "14-11-2019", "15-11-2019","27-12-2019"];


format: 'dd/mm/yyyy',

beforeShowDay: function(date){

dmy = date.getDate() + "-" + (date.getMonth() + 1) + "-" + date.getFullYear();

if(disableDates.indexOf(dmy) != -1){

return false;



return true;







It will help you...

Recommended Posts