Widget:VisitSchedulerRedux: Difference between revisions
Jump to navigation
Jump to search
Matt Pijoan (talk | contribs) No edit summary |
Matt Pijoan (talk | contribs) No edit summary |
||
(2 intermediate revisions by the same user not shown) | |||
Line 73: | Line 73: | ||
$( "#indexEventTime" ).change(function(){validateConstraints();}); | $( "#indexEventTime" ).change(function(){validateConstraints();}); | ||
$("#visit-1").change(function(){ | $("#visit-1").change(function(){ | ||
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()- | $("#visit-6").val(new Date(currentAppointment.getFullYear(), currentAppointment.getMonth(), currentAppointment.getDate()+60).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('destroy'); | ||
$("#visit-7").datepicker({minDate: new Date(currentAppointment.getFullYear(), currentAppointment.getMonth(), currentAppointment.getDate()- | $("#visit-7").val(new Date(currentAppointment.getFullYear(), currentAppointment.getMonth(), currentAppointment.getDate()+90).toDateString()); | ||
$("#visit-7").datepicker({minDate: new Date(currentAppointment.getFullYear(), currentAppointment.getMonth(), currentAppointment.getDate()-10), maxDate:new Date(currentAppointment.getFullYear(), currentAppointment.getMonth(), currentAppointment.getDate()+10)}); | |||
$("#visit-8").datepicker('destroy'); | $("#visit-8").datepicker('destroy'); | ||
$("#visit-8").datepicker({minDate: new Date(currentAppointment.getFullYear(), currentAppointment.getMonth(), currentAppointment.getDate()- | $("#visit-8").val(new Date(currentAppointment.getFullYear(), currentAppointment.getMonth(), currentAppointment.getDate()+180).toDateString()); | ||
$("#visit-8").datepicker({minDate: new Date(currentAppointment.getFullYear(), currentAppointment.getMonth(), currentAppointment.getDate()-10), maxDate:new Date(currentAppointment.getFullYear(), currentAppointment.getMonth(), currentAppointment.getDate()+10)}); | |||
$("#visit-9").datepicker('destroy'); | $("#visit-9").datepicker('destroy'); | ||
$("#visit-9").datepicker({minDate: new Date(currentAppointment.getFullYear(), currentAppointment.getMonth(), currentAppointment.getDate()- | $("#visit-9").val(new Date(currentAppointment.getFullYear(), currentAppointment.getMonth(), currentAppointment.getDate()+270).toDateString()); | ||
$("#visit-9").datepicker({minDate: new Date(currentAppointment.getFullYear(), currentAppointment.getMonth(), currentAppointment.getDate()-10), maxDate:new Date(currentAppointment.getFullYear(), currentAppointment.getMonth(), currentAppointment.getDate()+10)}); | |||
$("#visit-10").datepicker('destroy'); | $("#visit-10").datepicker('destroy'); | ||
$("#visit-10").datepicker({minDate: new Date(currentAppointment.getFullYear(), currentAppointment.getMonth(), currentAppointment.getDate()- | $("#visit-10").val(new Date(currentAppointment.getFullYear(), currentAppointment.getMonth(), currentAppointment.getDate()+365).toDateString()); | ||
$("#visit-10").datepicker({minDate: new Date(currentAppointment.getFullYear(), currentAppointment.getMonth(), currentAppointment.getDate()-10), maxDate:new Date(currentAppointment.getFullYear(), currentAppointment.getMonth(), currentAppointment.getDate()+10)}); | |||
}); | }); | ||
function validateConstraints(){ | function validateConstraints(){ |