I'm not very knowledgeable with javascript and I'm not sure how How can I open a Modal window if the difference between two dates is equal to X days Exe.
(If clicking on the field and date chosen has a difference of 1 day from the current date open modal1)
(If clicking the field and date chosen is earlier than the current date open modal2)
I have this script below
<?
date_default_timezone_set('America/Sao_Paulo');
$data_atual = date('Y-m-d');
?>
<input type="datetime-local" name="start" value="2015-03-23 00:00:00" />
<a href="#modal-simple1" data-toggle="modal" class="btn btn-primary">Abrir</a>
<!-- Modal 1 -->
<div class="modal fade" id="modal-simple1">
<div class="modal-dialog">
<div class="modal-content">
<!-- Modal heading -->
<div class="modal-header">
button type="button" class="close" data-dismiss="modal" aria-hidden="true">×
</button>
<h3 class="modal-title">Modal header</h3>
</div>
<div class="modal-body">
<p>
</p>
</div>
<div class="modal-footer"><input type="checkbox" /><font color="black"> Li e aceito
os termos para compra e uso do(s) serviço(s) acima citado(s).</font></h4>
<input type="submit" value="Confirmar Compra" class="btn btn-block btn-danger btn-
icon glyphicons home" />
</div>
</div>
</div>
</div>
<!-- // Modal END -->
<a href="#modal-simple2" data-toggle="modal" class="btn btn-primary">Abrir</a>
<!-- Modal 2 -->
<div class="modal fade" id="modal-simple2">
<div class="modal-dialog">
<div class="modal-content">
<!-- Modal heading -->
<div class="modal-header">
button type="button" class="close" data-dismiss="modal" aria-hidden="true">×
</button>
<h3 class="modal-title">Modal header</h3>
</div>
<div class="modal-body">
<p>
</p>
</div>
<div class="modal-footer"><input type="checkbox" /><font color="black"> Li e aceito
os termos para compra e uso do(s) serviço(s) acima citado(s).</font></h4>
<input type="submit" value="Confirmar Compra" class="btn btn-block btn-danger btn-
icon glyphicons home" />
</div>
</div>
</div>
</div>
<!-- // Modal END -->