I have the following problem: I have a list of services and each service has a production time, for example:
Service 1 - > 7 Days Habiles.
Service 2 - > 5 Daily Days.
This list comes from Mysql through a SELECT nested by ajax. What I need, is that depending on the service and its number of days of production time, these (days) are added to the datepicker as days that can not be selected. For example, if today is April 3, 2018 and the selected service has 7 working days, it is not possible to select a date less than these 7 days and the days must not be counted on Saturdays or Sundays. Currently, I already have blocked the days of Saturday and Sunday in my datepicker (it's not a big deal, but it's information you should know). File that returns the query by ajax of the select:
$consulta = mysql_query("SELECT * FROM hijos WHERE id_cliente = ".$id1."");
echo "<select name='tratamiento' class='form-control select2' >";
echo "<option value='0' selected='selected' disabled='disabled'>Elija Tratamiento</option>";
while($registro = mysql_fetch_row($consulta))
{
echo "<option value='".$registro[0]."'>".$registro[1]." --> Tiempo Estimado Entrega: ".$registro[5]." a ".$registro[6]." Días Hábiles</option>";
}
echo "</select>";
? >
Select HTML:
<div class="form-group m-b-15">
<label class="control-label">Seleccione Tratamiento</label>
<select name="subcategory" class="form-control select2" id="subcategory" >
<option value='' selected='selected'>Seleccione Tratamiento</option>
</select>
<span class="help-block" id="error"></span>
</div>
Date Picker content:
.datepicker({
format: 'dd/mm/yyyy',
autoclose: 'true',
language: 'es',
daysOfWeekDisabled: [0, 6],
startDate : currDate
})
If anyone has any notion of how to do this, I would greatly appreciate it. Greetings and thanks to all of you for your information.