I have to field start date and end date. How to make in end date, user can select date only more from start day, like in screen
this my js where I call data picker for my input
$(document).ready(function () { var $task_executions_from_date = $('#task_executions_from_date');
$task_executions_from_date.datepicker({
dateFormat: 'dd.mm.yy'
});
$task_executions_from_date.on('change', function () {
var test = $task_executions_from_date.val();
console.log(test);
});
var $task_executions_to_date = $('#task_executions_to_date');
$task_executions_to_date.datepicker({
dateFormat: 'dd.mm.yy',
beforeShowDay: function(date){
var arrayDate = $task_executions_from_date.val().split('.');
var start_date = new Date(arrayDate[2], arrayDate[1]-1, arrayDate[0]).getTime();
if (start_date) {
return date.getTime() > start_date;
}
return true;
}
});
what need put in beforeShowDay
for task_executions_to_date.datepicker
? like all days which > test
Now I have all date disabled, why not understand