Topic: Second datePicker can not select a date less than the first datePicker

AMCode free asked 4 years ago

As a title I have implemented two datePicker within my project, my goal is that the second datePicker can not select a date before the date selected in the first datePicker.

<div class="col-md-4">
<form name="NOME_FORM" method="post" action="registra_campagne.php" class="text-center border border-light p-5" onsubmit="return validateForm()">
<p class="h4 mb-4">Durata Campagna</p>
<div class="md-form">
<!--The "from" Date Picker -->
<input name="data_inizio" required placeholder="Data inizio" type="text" id="date-picker-example" class="form-control datepicker" >
<label for="date-picker-example">Inizio</label>

<div class="md-form">
<!--The "to" Date Picker -->
<input name="data_fine" placeholder="Data Fine" type="text" id="date-picker-example2" class="form-control datepicker">
<label for="date-picker-example2">Fine</label>
<input class="btn btn-info btn-block" name="submit" type="submit" value="Aggiungi"><br>


<div class="col-md-4"></div>

<script type="text/javascript" src="datepicker.js"></script>
<script type="text/javascript">

// Data Picker Initialization
min : new Date(),
onClose: function(){
min : $('.datepicker').val()

// Escape any “rule” characters with an exclamation mark (!).
format: 'yyyy/mm/dd',
formatSubmit: 'Y/m/d',
hiddenPrefix: 'prefix__',
hiddenSuffix: '__suffix'

closeOnSelect: false,
closeOnClear: false

twelvehour: true

darktheme: true,
twelvehour: false


Mikołaj Smoleński staff answered 4 years ago

Hi there,

Date Picker is a premium component, and according to our system, you use MDB Free version.

Please, provide us a number o your order or registered email to confirm your access to MDB Pro components and premium support.

Send it to me on email:

Mikołaj Smoleński

Please insert min. 20 characters.


Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.



Specification of the issue

  • User: Free
  • Premium support: No
  • Technology: MDB jQuery
  • MDB Version: 4.3.2
  • Device: pc
  • Browser: chrome
  • OS: mac
  • Provided sample code: Yes
  • Provided link: No