rem: trgt = strt + days; 
add: var trgt = strt + days; 
context: dojo.date.add = function(/*Date*/date, /*String*/interval, /*int*/amount){	//	summary	//		Add to a Date in intervals of different size, from milliseconds to years	//	//	date	//		Date object to start with	//	//	interval	//		A string representing the interval.  One of the following:	//			"year", "month", "day", "hour", "minute", "second", "millisecond", "quarter", "week", "weekday"	//	//	amount	//		How much to add to the date.	var sum = new Date(Number(date)); // convert to Number before copying to accomodate IE (#3112)	var fixOvershoot = false;	var property = "Date";	switch(interval){		case "day":			break;		case "weekday":			//i18n FIXME: assumes Saturday/Sunday weekend, but even this is not standard.  There are CLDR entries to localize this.			var dayOfMonth = date.getDate();			var weeks = 0;			var days = 0;			var strt = 0;			var trgt = 0;			var adj = 0;			// Divide the increment time span into weekspans plus leftover days			// e.g., 8 days is one 5-day weekspan / and two leftover days			// Can't have zero leftover days, so numbers divisible by 5 get			// a days value of 5, and the remaining days make up the number of weeks			var mod = amount % 5;			if(!mod){				days = (amount > 0) ? 5 : -5;				weeks = (amount > 0) ? ((amount-5)/5) : ((amount+5)/5);			}else{				days = mod;				weeks = parseInt(amount/5);			}			// Get weekday value for orig date param			strt = date.getDay();			// Orig date is Sat / positive incrementer			// Jump over Sun			if(strt == 6 && amount > 0){				adj = 1;			}else if(strt == 0 && amount < 0){			// Orig date is Sun / negative incrementer			// Jump back over Sat				adj = -1;			}			// Get weekday val for the new date			trgt = strt + days;			// New date is on Sat or Sun			if(trgt == 0 || trgt == 6){				adj = (amount > 0) ? 2 : -2;			}			// Increment by number of weeks plus leftover days plus			// weekend adjustments			amount = dayOfMonth + 7*weeks + days + adj;			break;		case "year":			property = "FullYear";			// Keep increment/decrement from 2/29 out of March			fixOvershoot = true;			break;		case "week":			amount *= 7;			break;		case "quarter":			// Naive quarter is just three months			amount *= 3;			// fallthrough...		case "month":			// Reset to last day of month if you overshoot			fixOvershoot = true;			property = "Month";			break;		case "hour":		case "minute":		case "second":		case "millisecond":			property = interval.charAt(0).toUpperCase() + interval.substring(1) + "s";	}	if(property){		sum["set"+property](sum["get"+property]()+amount);	}	if(fixOvershoot && (sum.getDate() < date.getDate())){		sum.setDate(0);	}	return sum; // Date};
meta: 4497	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/4497/d730a23a8aad9421688ed59728442039552bbfa2/date.js/buggy/date.js