Widget:VisitSchedulerRedux: Difference between revisions

Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
<includeonly>
<includeonly>
<!DOCTYPE html><html lang="en">
<head>
   <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="//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>
   <script src="//code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
   <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<script>
<script>
$(document).ready(function(){
$(document).ready(function(){
Line 28: Line 30:
var currentAppointment = new Date($("#indexEvent").val());
var currentAppointment = new Date($("#indexEvent").val());
$.each(timeConstraints, function(key, value){
$.each(timeConstraints, function(key, value){
currentAppointment = new Date(currentAppointment.getFullYear(), currentAppointment.getMonth(), currentAppointment.getDate()+value[0]);
this.currentAppointment = new Date(this.currentAppointment.getFullYear(), this.currentAppointment.getMonth(), this.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>");
$("#appointments").append("<tr><td>"+value[5]+"</td><td><input type='text' class='appointment' id='visit-"+key+"' value='"+this.currentAppointment.toDateString()+"' /></td><td><input type='checkbox' class='delayedInfusion' value='"+key+"' /></td><td>"+value[6]+"</td></tr>");
alert("#visit-"+key);
$("#visit-"+key).datepicker({minDate: this.currentAppointment, maxDate:new Date(this.currentAppointment.getFullYear(), this.currentAppointment.getMonth(), this.currentAppointment.getDate()+value[1])});
$("#visit-"+key).datepicker({minDate: currentAppointment, maxDate:new Date(currentAppointment.getFullYear(), currentAppointment.getMonth(), currentAppointment.getDate()+value[1])});
});
});
$(".appointment").change(function(){
$(".appointment").change(function(){
Line 70: Line 71:
</table>
</table>
</form>
</form>
</body>
</html>
</includeonly>
</includeonly>

Revision as of 20:42, 27 November 2018