Bootstrap Datepicker Disable Past Dates Example

Laravel 6 , Laravel

Nicesnippets

34448

30-11-2019


Bootstrap Datepicker Disable Past Dates Example

hii Guys,

In this example,We will learn disable past dates in bootstrap datepicker. so simply you will learn how to disable past dates in boostrap datepicker.

Solution:-


$('.datepicker').datepicker({

startDate: new Date()

});

Example:-

<!DOCTYPE html>

<html>

<head>

<title>Bootstrap Datepicker Disable Past Dates Example - nicesnippets.com/</title>

<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.3.1/css/bootstrap.css">

<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.9.0/css/bootstrap-datepicker.css">

<script src = "https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>

<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.9.0/js/bootstrap-datepicker.js"></script>

<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>

</head>

<body>

<div class="container">

<h1>Bootstrap Datepicker Disable Past Dates Example - nicesnippets.com/</h1>

<input type="text" name="date" class="form-control datepicker" autocomplete="off">

</div>

</body>

<script type="text/javascript">

$('.datepicker').datepicker({

startDate: new Date()

});

</script>

</html>

It will help you......


Recommended Posts