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 50: | Line 50: | ||
$(document).ready(function () { | $(document).ready(function () { | ||
//Update the Screening Visit Window | //Update the Screening Visit Window | ||
var $ | var $ = jQuery.noConflict(); | ||
//Check Entered Screening Visit Date | //Check Entered Screening Visit Date | ||
$ | $("#screenDate").datepicker({ | ||
onSelect: function() { | onSelect: function() { | ||
$("#eventDate").datepicker(); | $("#eventDate").datepicker(); | ||
Line 59: | Line 59: | ||
} | } | ||
}); | }); | ||
$ | $("#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 | ||
$ | $.datepicker.setDefaults({dateFormat: "dd-M-yy" }); | ||
$ | $(".date").datepicker(); | ||
nextApptHour = $( "#nextApptHour" ).spinner(); | nextApptHour = $( "#nextApptHour" ).spinner(); | ||
$ | $("#nextApptHour").spinner({min: 0}); | ||
$ | $("#nextApptHour").spinner({max: 24}); | ||
nextApptMinute = $( "#nextApptMinute" ).spinner(); | nextApptMinute = $( "#nextApptMinute" ).spinner(); | ||
$ | $("#nextApptMinute").spinner({min: 0}); | ||
$ | $("#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 = $ | day1 = $("#eventDate").datepicker("getDate"); | ||
screenDate = $ | 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,$ | // logDifferenceinDates(target.name,$("#nextApptDate").datepicker("getDate")) | ||
bumpDates(target.shortDescr,timeConstraints,target.dtar,$ | 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,$ | 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 = $ | 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); |