 return Math.round(delta); 
break; case HOUR: delta = houDiff; break; case MINUTE: delta = minDiff; break; case SECOND: delta = secDiff; break; case MILLISECOND: delta = msDiff; break; default:  break; } }   return Math.round(delta); 
dojo.date.diff = function(/* Date */ dtA, /* Date */ dtB, /* dojo.date.dateParts */ interv){//	summary://		Get the difference in a specific unit of time (e.g., number of months, weeks,//		days, etc.) between two dates.////	dtA://		A Javascript Date object////	dtB://		A Javascript Date object////	interv://		A constant representing the interval, e.g. YEAR, MONTH, DAY.  See dojo.date.dateParts.	// Accept timestamp input	if(typeof dtA == 'number'){dtA = new Date(dtA);}	if(typeof dtB == 'number'){dtB = new Date(dtB);}	var yeaDiff = dtB.getFullYear() - dtA.getFullYear();	var monDiff = (dtB.getMonth() - dtA.getMonth()) + (yeaDiff * 12);	var msDiff = dtB.getTime() - dtA.getTime(); // Millisecs	var secDiff = msDiff/1000;	var minDiff = secDiff/60;	var houDiff = minDiff/60;	var dayDiff = houDiff/24;	var weeDiff = dayDiff/7;	var delta = 0; // Integer return value	with(dojo.date.dateParts){		switch(interv){			case YEAR:				delta = yeaDiff;				break;			case QUARTER:				var mA = dtA.getMonth();				var mB = dtB.getMonth();				// Figure out which quarter the months are in				var qA = Math.floor(mA/3) + 1;				var qB = Math.floor(mB/3) + 1;				// Add quarters for any year difference between the dates				qB += (yeaDiff * 4);				delta = qB - qA;				break;			case MONTH:				delta = monDiff;				break;			case WEEK:				// Truncate instead of rounding				// Don't use Math.floor -- value may be negative				delta = parseInt(weeDiff);				break;			case DAY:				delta = dayDiff;				break;			case WEEKDAY:				var days = Math.round(dayDiff);				var weeks = parseInt(days/7);				var mod = days % 7;				// Even number of weeks				if (mod == 0) {					days = weeks*5;				}				// Weeks plus spare change (< 7 days)				else {					var adj = 0;					var aDay = dtA.getDay();					var bDay = dtB.getDay();						weeks = parseInt(days/7);					mod = days % 7;					// Mark the date advanced by the number of					// round weeks (may be zero)					var dtMark = new Date(dtA);					dtMark.setDate(dtMark.getDate()+(weeks*7));					var dayMark = dtMark.getDay();					// Spare change days -- 6 or less					// ----------					// Positive diff					if (dayDiff > 0) {						switch (true) {							// Range starts on Sat							case aDay == 6:								adj = -1;								break;							// Range starts on Sun							case aDay == 0:								adj = 0;								break;							// Range ends on Sat							case bDay == 6:								adj = -1;								break;							// Range ends on Sun							case bDay == 0:								adj = -2;								break;							// Range contains weekend							case (dayMark + mod) > 5:								adj = -2;								break;							default:								// Do nothing								break;						}					}					// Negative diff					else if (dayDiff < 0) {						switch (true) {							// Range starts on Sat							case aDay == 6:								adj = 0;								break;							// Range starts on Sun							case aDay == 0:								adj = 1;								break;							// Range ends on Sat							case bDay == 6:								adj = 2;								break;							// Range ends on Sun							case bDay == 0:								adj = 1;								break;							// Range contains weekend							case (dayMark + mod) < 0:								adj = 2;								break;							default:								// Do nothing								break;						}					}					days += adj;					days -= (weeks*2);				}				delta = days;				break;			case HOUR:				delta = houDiff;				break;			case MINUTE:				delta = minDiff;				break;			case SECOND:				delta = secDiff;				break;			case MILLISECOND:				delta = msDiff;				break;			default:				// Do nothing				break;		}	}	// Round for fractional values and DST leaps	return Math.round(delta); // Number (integer)};
6315	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/6315/2f1d2cb699c9d9329e8b782b0463156e211cb0f6/struts_dojo.js.uncompressed.js/buggy/src/main/resources/org/apache/struts2/static/dojo/struts_dojo.js.uncompressed.js