Since Last Transfusion

Last Transfusion





<!– Begin
function howLong(yr, mo, dy) { //Parameters are calendar Year,Month,Day
var moFlag = 0;
var dyFlag = 0;
var dy = frm.day.value;
var mo = frm.month.value;
var yr = frm.year.value;
var nDate = new Date(); // current date (local)
var nowTime = nDate.getTime(); // current time (UTC)
var thenTime = Date.UTC(yr, mo-1, dy); // specified time (UTC)
var thisYear = nDate.getFullYear();
var thisMonth = nDate.getMonth();
var thisDay = nDate.getDate();
if (isNaN(dy) || isNaN(mo) || isNaN(yr)) {
window.alert("That is not a valid date. Numbers only, please.");
frm.day.focus();
return false
}
if (dy31) {
window.alert(“Day “+dy+” of Month “+mo+” is not a valid date”);
frm.day.focus();
return false
} else {
dyFlag=1;
}
if (dy>30 && (mo == 2 || mo==4 || mo==6 || mo==9 || mo==11)) {
window.alert(“Day “+dy+” of Month “+mo+” is not a valid date”);
frm.day.focus();
return false
} else {
dyFlag=1;
}
if (dy>29 && mo==2) {
window.alert(“Day “+dy+” of Month “+mo+” is not a valid date”);
frm.day.focus();
return false
} else {
dyFlag=1;
}
if ((mo == 2 && dy == 29) && ((yr%4 != 0) || (yr%100 == 0 && yr%400 != 0))) {
window.alert(“29th of February is not a valid date in “+yr);
frm.day.focus();
return false
} else {
dyFlag=1;
}
if (mo12) {
window.alert(“Day “+dy+” of Month “+mo+” is not a valid date”);
frm.month.focus();
return false
} else {
moFlag=1;
}
if (dyFlag==1 && moFlag==1) {
if (nowTime >= thenTime) { //—————–Past or present time
if ((thisMonth > mo-1) || ((thisMonth == mo-1) && (thisDay >= dy))) {
whYrs = thisYear – yr;
spareDys = parseInt((nowTime – Date.UTC(thisYear,mo-1,dy))/(3600000*24));
if ((mo == 2 && dy == 29) && ((thisYear%4 != 0) || (thisYear%100 == 0 && thisYear%400 != 0))) {spareDys = spareDys + 1}
} else {
whYrs = thisYear – yr – 1;
spareDys = parseInt((nowTime – Date.UTC(thisYear-1,mo-1,dy))/(3600000*24));
if ((mo == 2 && dy == 29) && (((thisYear-1)%4 != 0) || ((thisYear-1)%100 == 0 && (thisYear-1)%400 != 0))) {spareDys = spareDys + 1}
}
} else { //—————————-Future time
if ((thisMonth < mo-1) || ((thisMonth == mo-1)&& (thisDay = thenTime) {
frm.timeBetween.value = “It is “+whYrs +
(whYrs == 1 ? ” Year and ” : ” Years and “) + spareDys +
(spareDys == 1 ? ” Day ” : ” Days “) + “since then”
} else {
frm.timeBetween.value = “It is “+whYrs +
(whYrs == 1 ? ” Year and ” : ” Years and “) + spareDys +
(spareDys == 1 ? ” Day ” : ” Days “) + “until then”
}
}
// End –>



Aplastic Anemia


FIRST TIMERS

aamds.org 
mds.org


FREE Book Preview




FORUM/TALK



Research BLOG
 

mds forum

    
  
  

    
Web

Site 



Aplastic Central

Bone Marrow Disorders

Live Chat

Old Forums

Short List


 Transplants

Aplastic Resources

AA to MDS?

Music

Bruce Story

Patient Stories

Wellness


Time Since Your Last Transfusion

Enter a date Day, Month and Year in numbers:



dd mm yyyy




Free JavaScripts provided

by The JavaScript Source