I used the following jQuery code to enter dates in my input fields, to have inputs "from"and "to".
$("#dt1").datepicker({
dateFormat: "dd-M-yy",
minDate: 0,
onSelect: function (date) {
var dt2 = $('#dt2');
var startDate = $(this).datepicker('getDate');
var minDate = $(this).datepicker('getDate');
dt2.datepicker('setDate', minDate);
startDate.setDate(startDate.getDate() + 360);
dt2.datepicker('option', 'maxDate', startDate);
dt2.datepicker('option', 'minDate', minDate);
$(this).datepicker('option', 'minDate', minDate);
}
});
$('#dt2').datepicker({
dateFormat: "dd-M-yy"
});
If I select the first date as 04/19/2017, the second date automatically starts from 04/19/2017. Question: how can I make my second date only the start of counting for one day after the first selected date?
The value will be 04/20/2017 instead of 19 ...
Here you can see all my violin
Hope you can help.
source
share