Widget:MattTest: Difference between revisions
Jump to navigation
Jump to search
Matt Pijoan (talk | contribs) No edit summary |
Matt Pijoan (talk | contribs) No edit summary |
||
Line 49: | Line 49: | ||
$(document).ready(function () { | $(document).ready(function () { | ||
//Update the Screening Visit Window | //Update the Screening Visit Window | ||
Line 60: | Line 55: | ||
$("#screenDate").datepicker({ | $("#screenDate").datepicker({ | ||
onSelect: function() { | onSelect: function() { | ||
checkScreenDate($( | checkScreenDate($(this).datepicker("getDate"),$("#eventDate").val()); | ||
} | } | ||
}); | }); | ||
Line 66: | Line 61: | ||
onSelect: function(curDate, instance) { | onSelect: function(curDate, instance) { | ||
if(curDate != instance.lastVal) { | if(curDate != instance.lastVal) { | ||
screenUpdate($( | screenUpdate($(this).datepicker("getDate")); | ||
} | } | ||
} | } | ||
Line 96: | Line 91: | ||
timeConstraints = checkStudy($("#subStudy").val()); | timeConstraints = checkStudy($("#subStudy").val()); | ||
lockFields("disabled"); | lockFields("disabled"); | ||
day1 = | day1 = $("#eventDate").datepicker("getDate"); | ||
screenDate = | screenDate = $("#screenDate").datepicker("getDate"); | ||
target = targetDates(visitCounter); | target = targetDates(visitCounter); | ||
Line 802: | Line 797: | ||
function screenUpdate(date){ | function screenUpdate(date){ | ||
var event = | var event = date; | ||
var screenMin = new Date(event.getFullYear(),event.getMonth(),event.getDate()); | var screenMin = new Date(event.getFullYear(),event.getMonth(),event.getDate()); | ||
Line 812: | Line 807: | ||
} | } | ||
function checkScreenDate( | function checkScreenDate(screen, eventString){ | ||
var | var dateString = eventString.split("-"); | ||
var event = new Date(dateString[2],dateString[1],dateString[0]); | |||
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 ); |