I have a jQuery function which redirect to "/schedule" page after adding the task , but I want to redirect that page to a specific date result(TaskDate:
$("#datepicker").data('datepicker').getFormattedDate('yyyy-mm-dd')).
function addTask() {
$.post("/add-task",
{
ProjectID: $("#project").val(),
TaskDate: $("#datepicker").data('datepicker').getFormattedDate('yyyy-mm-dd'),
Workers: $("#workers").val(),
Equipment: $("#equipment").val(),
Material: $("#material").val(),
Notes: $("#notes").val()
}, function (res) {
if (res == 1) {
window.location.href = '/schedule';
} else {
$("#error").show();
}
});
}
If we add the task for 15 December it should shows the list from 15 December to upcoming week . but now it comeback to current week which is "/schedule" page