rem: if ( isInArray(working_days, e.getDay()) ) e.setDate(e.getDate() + 1); 
add: { e.setDate(e.getDate() + 1); if ( !isInArray(working_days, e.getDay()) ) i--; } 
context: function calcFinish(f) {	//var int_st_date = new String(f.task_start_date.value);	var int_st_date_time = new String(f.task_start_date.value + f.start_hour.value + f.start_minute.value);		var int_st_date = int_st_date_time;	var e = new Date(int_st_date_time.substring(0,4),(int_st_date_time.substring(4,6)-1),int_st_date_time.substring(6,8), int_st_date_time.substring(8,10), int_st_date_time.substring(10,12));	// The task duration	var durn = parseFloat(f.task_duration.value);//hours	var durnType = parseFloat(f.task_duration_type.value); //1 or 24	//temporary variables	var inc = durn;	var hoursToAddToLastDay = 0;	var hoursToAddToFirstDay = durn;	var fullWorkingDays = 0;	if ( durnType==24 ) {		fullWorkingDays = Math.ceil(inc);		e.setMinutes( 0 );	 	for (var i = 0; i < fullWorkingDays; i++)			if ( isInArray(working_days, e.getDay()) )							e.setDate(e.getDate() + 1);		f.end_hour.value = f.start_hour.value;	} else {		hoursToAddToFirstDay = inc;		if ( e.getHours() + inc > cal_day_end )			hoursToAddToFirstDay = cal_day_end - e.getHours();		if ( hoursToAddToFirstDay > workHours )			hoursToAddToFirstDay = workHours;		inc -= hoursToAddToFirstDay;		hoursToAddToLastDay = inc % workHours;		fullWorkingDays = Math.round((inc - hoursToAddToLastDay) / workHours);		if (hoursToAddToLastDay <= 0)			e.setHours(e.getHours()+hoursToAddToFirstDay);		else		{			e.setHours(cal_day_start+hoursToAddToLastDay);			e.setDate(e.getDate() + 1);		}		if (fullWorkingDays > 0)			e.setDate(e.getDate() + 1);		e.setMinutes( 0 );	 	for (var i = 0; i < Math.ceil(fullWorkingDays); i++)			if ( isInArray(working_days, e.getDay()) )				e.setDate(e.getDate() + 1);		f.end_hour.value = (e.getHours() < 10 ? "0"+e.getHours() : e.getHours());	}		var tz1 = "";	var tz2 = "";	if ( e.getDate() < 10 ) tz1 = "0";	if ( (e.getMonth()+1) < 10 ) tz2 = "0";	f.task_end_date.value = e.getUTCFullYear()+tz2+(e.getMonth()+1)+tz1+e.getDate();	//f.end_date.value = tz2+(e.getMonth()+1)+"/"+tz1+e.getDate()+"/"+e.getUTCFullYear(); // MM/DD/YY	//f.end_date.value = tz1+e.getDate()+"/"+tz2+(e.getMonth()+1)+"/"+e.getUTCFullYear(); // DD/MM/YY	var url = 'index.php?m=public&a=date_format&dialog=1&field='+f.name+'.end_date&date=' + f.task_end_date.value;	thread = window.frames['thread']; //document.getElementById('thread');	thread.location = url;	setAMPM(f.end_hour);}
meta: 6222	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/6222/3b52c39e0095c1dbeffc376da2a1a80ba8a373dd/addedit.js/buggy/dotproject/modules/tasks/addedit.js