This is the comparison, since it does not allow me to compare apparently to be two types of input
different since I do it with two type date and it works, and I do not do so because in input
type datetime
I show the date of the system and in the other input
I select the date wanting to compare that the income is less than the delivery.
<div class="form-group" >
<div class="">
<label for="">Fecha de Ingreso</label>
<input class="form-control" type="datetime" disabled="true"
id="fecha" name="fecha" value="<?php echo date("d/m/Y H:i:s");?>" size="10"/>
<span class="help-block"></span>
</div>
</div>
<div class="form-group">
<div class="">
<label style="color: #000">Fecha y Hora de Entrega</label>
<input class="form-control" type="datetime-local" name="fecha_ent" id="fecha_ent" style="" required/>
<span class="help-block"></span>
</div>
</div>
Here I compare them with JavaScript , and always shows the error message:
fecha_ing1 = $('#fecha').val();
fecha_ent = $('#fecha_ent').val();
mensajero = $('#mensajero').val();
solicita = $('#solicita').val();
contacto = $('#contacto').val();
if (fecha_ent == null || fecha_ent.length == 0 || /^\s+$/.test(fecha_ent) || fecha_ent > fecha_ing1) {
var delay = alertify.get('notifier', 'delay');
alertify.alert("Error", "Digita la fecha y hora Completa y la real");
return false
}