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 |
||
Line 9: | Line 9: | ||
$( "#indexEvent" ).datepicker(); | $( "#indexEvent" ).datepicker(); | ||
$( "#indexEvent" ).change(function(){ | $( "#indexEvent" ).change(function(){ | ||
$( "#appointments" ).html("<tr><th>Visit Number</th><th>Visit Date</th><th>Delayed Infusion?</th><th>Visit Description</th></tr>"); | $( "#appointments" ).html("<tr><th>Visit Number</th><th>Visit Date</th><th>Visit Time</th><th>Delayed Infusion?</th><th>Visit Description</th></tr>"); | ||
$( "#appointments" ).show(); | $( "#appointments" ).show(); | ||
var schedule = visitSchedule($("patientID").val(),$("#assigned").val(),new Date($( "#indexEvent" ).val())); | var schedule = visitSchedule($("patientID").val(),$("#assigned").val(),new Date($( "#indexEvent" ).val())); | ||
Line 37: | Line 37: | ||
currentAppointment = new Date(currentAppointment.getFullYear(), currentAppointment.getMonth(), currentAppointment.getDate()+value[0]); | currentAppointment = new Date(currentAppointment.getFullYear(), currentAppointment.getMonth(), currentAppointment.getDate()+value[0]); | ||
if(key <= 4){ | if(key <= 4){ | ||
$("#appointments").append("<tr><td>"+value[5]+"</td><td><input type='text' class='appointment' id='visit-"+key+"' value='"+currentAppointment.toDateString()+"' /></td><td><input type='checkbox' class='delayedInfusion' value='"+key+"' /></td><td>"+value[6]+"</td></tr>"); | $("#appointments").append("<tr><td>"+value[5]+"</td><td><input type='text' class='appointment' id='visit-"+key+"' value='"+currentAppointment.toDateString()+"' /></td><td><input type='time' id='visitTime-"+key+"' value='"+$("#indexEventTime").val()+"'></td><td><input type='checkbox' class='delayedInfusion' value='"+key+"' /></td><td>"+value[6]+"</td></tr>"); | ||
} else { | } else { | ||
$("#appointments").append("<tr><td>"+value[5]+"</td><td><input type='text' id='visit-"+key+"' value='"+currentAppointment.toDateString()+"' /></td><td></td><td>"+value[6]+"</td></tr>"); | $("#appointments").append("<tr><td>"+value[5]+"</td><td><input type='text' id='visit-"+key+"' value='"+currentAppointment.toDateString()+"' /></td><td><input type='time' id='visitTime-"+key+"' value='"+$("#indexEventTime").val()+"'></td><td></td><td>"+value[6]+"</td></tr>"); | ||
} | } | ||
$("#visit-"+key).datepicker({minDate: new Date(currentAppointment.getFullYear(), currentAppointment.getMonth(), currentAppointment.getDate()-value[2]), maxDate:new Date(currentAppointment.getFullYear(), currentAppointment.getMonth(), currentAppointment.getDate()+value[1])}); | $("#visit-"+key).datepicker({minDate: new Date(currentAppointment.getFullYear(), currentAppointment.getMonth(), currentAppointment.getDate()-value[2]), maxDate:new Date(currentAppointment.getFullYear(), currentAppointment.getMonth(), currentAppointment.getDate()+value[1])}); |