Widget:MattTest: Difference between revisions

Jump to navigation Jump to search
No edit summary
No edit summary
Line 50: Line 50:
$(document).ready(function () {
$(document).ready(function () {
//Update the Screening Visit Window
//Update the Screening Visit Window
var $j = jQuery.noConflict();
var $ = jQuery.noConflict();


//Check Entered Screening Visit Date
//Check Entered Screening Visit Date
$j("#screenDate").datepicker({
$("#screenDate").datepicker({
onSelect: function() {
onSelect: function() {
$("#eventDate").datepicker();
$("#eventDate").datepicker();
Line 59: Line 59:
}
}
});
});
$j("#eventDate").datepicker({
$("#eventDate").datepicker({
onSelect: function(curDate, instance) {
onSelect: function(curDate, instance) {
    if(curDate != instance.lastVal) {
    if(curDate != instance.lastVal) {
Line 68: Line 68:


//"Enable" some pretty jQuery UI actions
//"Enable" some pretty jQuery UI actions
     $j.datepicker.setDefaults({dateFormat: "dd-M-yy" });
     $.datepicker.setDefaults({dateFormat: "dd-M-yy" });
$j(".date").datepicker();
$(".date").datepicker();
nextApptHour = $( "#nextApptHour" ).spinner();
nextApptHour = $( "#nextApptHour" ).spinner();
$j("#nextApptHour").spinner({min: 0});
$("#nextApptHour").spinner({min: 0});
$j("#nextApptHour").spinner({max: 24});
$("#nextApptHour").spinner({max: 24});
nextApptMinute = $( "#nextApptMinute" ).spinner();
nextApptMinute = $( "#nextApptMinute" ).spinner();
$j("#nextApptMinute").spinner({min: 0});
$("#nextApptMinute").spinner({min: 0});
$j("#nextApptMinute").spinner({max: 60});
$("#nextApptMinute").spinner({max: 60});
day1 = new Date();
day1 = new Date();
Line 92: Line 92:
timeConstraints = checkStudy($("#subStudy").val());
timeConstraints = checkStudy($("#subStudy").val());
lockFields("disabled");
lockFields("disabled");
day1 = $j("#eventDate").datepicker("getDate");
day1 = $("#eventDate").datepicker("getDate");
screenDate = $j("#screenDate").datepicker("getDate");
screenDate = $("#screenDate").datepicker("getDate");
target = targetDates(visitCounter);
target = targetDates(visitCounter);
Line 157: Line 157:
//This uses the information from the previous iteration to decide if the infusion dates need
//This uses the information from the previous iteration to decide if the infusion dates need
//to be bumped back.
//to be bumped back.
// logDifferenceinDates(target.name,$j("#nextApptDate").datepicker("getDate"))
// logDifferenceinDates(target.name,$("#nextApptDate").datepicker("getDate"))
bumpDates(target.shortDescr,timeConstraints,target.dtar,$j("#nextApptDate").datepicker("getDate"));
bumpDates(target.shortDescr,timeConstraints,target.dtar,$("#nextApptDate").datepicker("getDate"));
//Update Patient Schedule Table
//Update Patient Schedule Table
Line 204: Line 204:
//to be bumped back.
//to be bumped back.
// logDifferenceinDates(target.name,$("#nextApptDate").datepicker("getDate"))
// logDifferenceinDates(target.name,$("#nextApptDate").datepicker("getDate"))
bumpDates(target.shortDescr,timeConstraints,target.dtar,$j("#nextApptDate").datepicker("getDate"));
bumpDates(target.shortDescr,timeConstraints,target.dtar,$("#nextApptDate").datepicker("getDate"));
//Update Patient Schedule Table
//Update Patient Schedule Table
Line 246: Line 246:


function submitNextAppt (){
function submitNextAppt (){
var scheduledDate = $j("#nextApptDate").datepicker("getDate");
var scheduledDate = $("#nextApptDate").datepicker("getDate");
var nextApptDate = new Date(scheduledDate.getFullYear(),scheduledDate.getMonth(),scheduledDate.getDate(),("0"+$("#nextApptHour").val()).slice(-2),("0"+$("#nextApptMinute").val()).slice(-2) )
var nextApptDate = new Date(scheduledDate.getFullYear(),scheduledDate.getMonth(),scheduledDate.getDate(),("0"+$("#nextApptHour").val()).slice(-2),("0"+$("#nextApptMinute").val()).slice(-2) )
var tstart = ("0"+$("#nextApptHour").val()).slice(-2)+("0"+$("#nextApptMinute").val()).slice(-2);
var tstart = ("0"+$("#nextApptHour").val()).slice(-2)+("0"+$("#nextApptMinute").val()).slice(-2);

Revision as of 14:10, 7 May 2018