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.12.4.js"></script>
<script src="https://code.jquery.com/jquery-1.9.1.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($(this).datepicker("getDate"),$("#eventDate").val());
checkScreenDate();
}
}
});
});
Line 61: Line 78:
onSelect: function(curDate, instance) {
onSelect: function(curDate, instance) {
    if(curDate != instance.lastVal) {
    if(curDate != instance.lastVal) {
screenUpdate($(this).datepicker("getDate"));
screenUpdate();
    }
    }
  }
  }
Line 145: Line 162:
});
});
 
});
/////////////
/////////////
//
//
Line 796: Line 813:
}
}


function screenUpdate(date){
function screenUpdate(){
var event = date;
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 807: Line 824:
}
}


function checkScreenDate(screen, eventString){
function checkScreenDate(){
                var dateString = eventString.split("-");
var screen = $("#screenDate").datepicker("getDate");
var event = new Date(dateString[2],dateString[1],dateString[0]);
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());
var screenMax = new Date(event.getFullYear(),event.getMonth(),event.getDate() + 5 );
var screenMax = new Date(event.getFullYear(),event.getMonth(),event.getDate() + 5 );
Line 956: Line 974:
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:32, 30 April 2018