Widget:VisitSchedulerRedux: Difference between revisions

Jump to navigation Jump to search
No edit summary
No edit summary
Line 75: Line 75:
currentAppointment = new Date($("#visit-1").val());
currentAppointment = new Date($("#visit-1").val());
$("#visit-6").datepicker('destroy');
$("#visit-6").datepicker('destroy');
$("#visit-6").datepicker({minDate: new Date(currentAppointment.getFullYear(), currentAppointment.getMonth(), currentAppointment.getDate()-value[2]), maxDate:new Date(currentAppointment.getFullYear(), currentAppointment.getMonth(), currentAppointment.getDate()+60)});
$("#visit-6").val(new Date(currentAppointment.getFullYear(), currentAppointment.getMonth(), currentAppointment.getDate()+60).toDateString());
$("#visit-6").val(updatedAppointment.toDateString());
$("#visit-6").datepicker({minDate: new Date(currentAppointment.getFullYear(), currentAppointment.getMonth(), currentAppointment.getDate()-10), maxDate:new Date(currentAppointment.getFullYear(), currentAppointment.getMonth(), currentAppointment.getDate()+10)});
$("#visit-7").datepicker('destroy');
 
$("#visit-7").datepicker({minDate: new Date(currentAppointment.getFullYear(), currentAppointment.getMonth(), currentAppointment.getDate()-value[2]), maxDate:new Date(currentAppointment.getFullYear(), currentAppointment.getMonth(), currentAppointment.getDate()+90)});
$("#visit-7").val(updatedAppointment.toDateString());
$("#visit-8").datepicker('destroy');
$("#visit-8").datepicker({minDate: new Date(currentAppointment.getFullYear(), currentAppointment.getMonth(), currentAppointment.getDate()-value[2]), maxDate:new Date(currentAppointment.getFullYear(), currentAppointment.getMonth(), currentAppointment.getDate()+180)});
$("#visit-8").val(updatedAppointment.toDateString());
$("#visit-9").datepicker('destroy');
$("#visit-9").datepicker({minDate: new Date(currentAppointment.getFullYear(), currentAppointment.getMonth(), currentAppointment.getDate()-value[2]), maxDate:new Date(currentAppointment.getFullYear(), currentAppointment.getMonth(), currentAppointment.getDate()+270)});
$("#visit-9").val(updatedAppointment.toDateString());
$("#visit-10").datepicker('destroy');
$("#visit-10").datepicker({minDate: new Date(currentAppointment.getFullYear(), currentAppointment.getMonth(), currentAppointment.getDate()-value[2]), maxDate:new Date(currentAppointment.getFullYear(), currentAppointment.getMonth(), currentAppointment.getDate()+365)});
$("#visit-10").val(updatedAppointment.toDateString());
});
});
function validateConstraints(){
function validateConstraints(){

Revision as of 20:26, 24 July 2019