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 1: | Line 1: | ||
<includeonly> | <includeonly> | ||
<link rel="stylesheet" href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css"> | <link rel="stylesheet" href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css"> | ||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> | <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> | ||
Line 28: | Line 26: | ||
this.patientID = patient; | this.patientID = patient; | ||
this.assigned = assigned; | this.assigned = assigned; | ||
$.each(timeConstraints, function(key, value){ | $.each(timeConstraints, function(key, value){ | ||
if(key == 1){ | |||
$("#appointments").append("<tr><td>"+value[5]+"</td><td><input type='text' class='appointment' id='visit-"+key+"' value='"+ | currentAppointment = new Date($( "#indexEvent" ).val()); | ||
$("#visit-"+key).datepicker({minDate: | } else { | ||
currentAppointment = new Date($("#visit-"+(key-1)).val()); | |||
} | |||
currentAppointment = new Date(currentAppointment.getFullYear(), currentAppointment.getMonth(), currentAppointment.getDate()+value[0]); | |||
$("#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>"); | |||
$("#visit-"+key).datepicker({minDate: currentAppointment, maxDate:new Date(currentAppointment.getFullYear(), currentAppointment.getMonth(), currentAppointment.getDate()+value[1])}); | |||
}); | }); | ||
$(".appointment").change(function(){ | $(".appointment").change(function(){ | ||
Line 71: | Line 73: | ||
</table> | </table> | ||
</form> | </form> | ||
</includeonly> | </includeonly> |