Widget:MattTest: Difference between revisions

Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
<includeonly>
<includeonly>
<script src="https://code.jquery.com/jquery-1.9.1.js"></script>
  <script src="https://code.jquery.com/jquery-1.12.4.js"></script>
  <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<link rel="stylesheet" href="https://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
<link rel="stylesheet" href="https://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
<script src="https://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
<script type="text/javascript">
<script type="text/javascript">
// From https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/keys
// From https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/keys
Line 50: Line 50:
$(document).ready(function () {
$(document).ready(function () {
//Update the Screening Visit Window
//Update the Screening Visit Window
$("#missedInfusion").dialog({
 
autoOpen: false
});
$("#beforeWindow").dialog({
autoOpen: false
});
$("#afterWindow").dialog({
autoOpen: false
});
$("#missedInfusionWarning").dialog({
autoOpen: false
});
$("#delayedInfusion").dialog({
autoOpen: false
});


//Check Entered Screening Visit Date
//Check Entered Screening Visit Date
$("#screenDate").datepicker({
$("#screenDate").datepicker({
onSelect: function() {
onSelect: function() {
checkScreenDate();
$("#eventDate").datepicker();
checkScreenDate($(this).datepicker("getDate"),$("#eventDate").datepicker("getDate"));
}
}
});
});
Line 78: Line 62:
onSelect: function(curDate, instance) {
onSelect: function(curDate, instance) {
    if(curDate != instance.lastVal) {
    if(curDate != instance.lastVal) {
screenUpdate();
screenUpdate($(this).datepicker("getDate"));
    }
    }
  }
  }
Line 162: Line 146:
});
});
});
 
/////////////
/////////////
//
//
Line 813: Line 797:
}
}


function screenUpdate(){
function screenUpdate(date){
var event = $("#eventDate").datepicker("getDate");
var event = date;
var screenMin = new Date(event.getFullYear(),event.getMonth(),event.getDate());
var screenMin = new Date(event.getFullYear(),event.getMonth(),event.getDate());
Line 824: Line 808:
}
}


function checkScreenDate(){
function checkScreenDate(screen, event){
var screen = $("#screenDate").datepicker("getDate");
var event = $("#eventDate").datepicker("getDate");
var screenMin = new Date(event.getFullYear(),event.getMonth(),event.getDate());
var screenMin = new Date(event.getFullYear(),event.getMonth(),event.getDate());
Line 974: Line 956:
console.log(visitName+" occurs Study Day"+studyDays);
console.log(visitName+" occurs Study Day"+studyDays);
}
}
 
});
</script>
</script>
<style type="text/css">
<style type="text/css">

Revision as of 19:37, 30 April 2018