Widget:VisitSchedulerRedux: Difference between revisions

Jump to navigation Jump to search
No edit summary
No edit summary
Line 139: Line 139:
$("#save").click(function(){
$("#save").click(function(){
var cal = ics();
var cal = ics();
var appointmentDateAndTime = new Date();
$.each(timeConstraints, function(key, value){
$.each(timeConstraints, function(key, value){
if(!$("#visit-"+key).hasClass("invalid")){
if(!$("#visit-"+key).hasClass("invalid")){
var appointmentDateAndTime = new Date($("#visit-"+key).val());
appointmentDateAndTime = new Date($("#visit-"+key).val());
if($("#visitTime-"+key).length){
cal.addEvent(value[5]+" for "+$("#patientID").val(),value[6],"Office of "+$("#assigned").val(),$("#visit-"+key).val(),$("#visit-"+key).val());
appointmentDateAndTime.setHours($("#visitTime-"+key).val().split(":")[0]);
appointmentDateAndTime.setMinutes($("#visitTime-"+key).val().split(":")[1]);
}
var appointmentEndTime = appointmentDateAndTime;
appointmentEndTime.setMinutes(appointmentDateAndTime.getMinutes()+30);
cal.addEvent(value[5]+" for "+$("#patientID").val(),value[6],"Office of "+$("#assigned").val(),appointmentDateAndTime.toDateString(),appointmentEndTime.toDateString());
}
}
});
});
cal.download();
cal.download();
});
});
});
};
};

Revision as of 17:21, 24 January 2019