rem: var theTime = new Date(this.getYear(today), today.getMonth(), today.getDate(), today.getHours(), today.getMinutes(), ((type=="timesec")?today.getSeconds():0)); this.lastTime = this.getTimeSecs(theTime); 
context: function evalFunc_input(type,inVal)	{	if (type=="md5") {		return MD5(inVal);	}	if (type=="trim") {		return this.ltrim(this.btrim(inVal));	}	if (type=="int") {		return this.parseInt(inVal);	}	if (type=="double2") {		return this.parseDouble(inVal);	}	var today = new Date()	var add=0;	var value = this.ltrim(inVal);	var values = new evalFunc_split(value);	var theCmd = value.substr(0,1);	value = this.caseSwitch(type,value);	if (value=="") {		return "";		return 0;	// Why would I ever return a zero??? (20/12/01)	}	switch (type)	{		case "datetime":			switch (theCmd)	{				case "d":				case "t":				case "n":					var theTime = new Date(this.getYear(today), today.getMonth(), today.getDate(), today.getHours(), today.getMinutes());					this.lastDate = this.getSecs(theTime)					if (values.valPol[1])	{						add = this.pol(values.valPol[1],this.parseInt(values.values[1]));					}				break;				case "+":				case "-":					if (values.valPol[1])	{						add = this.pol(values.valPol[1],this.parseInt(values.values[1]));					}				break;				default:					var index = value.indexOf(' ');					if (index!=-1)	{						var theSecs = this.input("date",value.substr(index,value.length)) + this.input("time",value.substr(0,index));						this.lastDate = theSecs;					}			}			this.lastDate+=add*24*60*60;			return this.lastDate;		break;		case "year":			switch (theCmd)	{				case "d":				case "t":				case "n":					var theTime = today;					this.lastYear = this.getYear(theTime);					if (values.valPol[1])	{						add = this.pol(values.valPol[1],this.parseInt(values.values[1]));					}				break;				case "+":				case "-":					if (values.valPol[1])	{						add = this.pol(values.valPol[1],this.parseInt(values.values[1]));					}				break;				default:					if (values.valPol[2])	{						add = this.pol(values.valPol[2],this.parseInt(values.values[2]));					}					var year = (values.values[1])?this.parseInt(values.values[1]):this.getYear(today);						if (  (year>=0&&year<38) || (year>=70&&year<100) || (year>=1970&&year<2038)	)	{							if (year<100)	{								year = (year<38) ? year+=2000 : year+=1900;							}						} else {year = this.getYear(today);}					this.lastYear = year			}			this.lastYear+=add;			return this.lastYear;		break;		case "date":			switch (theCmd)	{				case "d":				case "t":				case "n":					var theTime = new Date(this.getYear(today), today.getMonth(), today.getDate());					this.lastDate = this.getSecs(theTime);					if (values.valPol[1])	{						add = this.pol(values.valPol[1],this.parseInt(values.values[1]));					}				break;				case "+":				case "-":					if (values.valPol[1])	{						add = this.pol(values.valPol[1],this.parseInt(values.values[1]));					}				break;				default:					var index = 4;					if (values.valPol[index])	{						add = this.pol(values.valPol[index],this.parseInt(values.values[index]));					}					if (values.values[1] && values.values[1].length>2)	{						if (values.valPol[2])	{							add = this.pol(values.valPol[2],this.parseInt(values.values[2]));						}						var temp = values.values[1];						values = new evalFunc_splitSingle(temp);					}					var year = (values.values[3])?this.parseInt(values.values[3]):this.getYear(today);						if (  (year>=0&&year<38) || (year>=70&&year<100) || (year>=1970&&year<2038)	)	{							if (year<100)	{								year = (year<38) ? year+=2000 : year+=1900;							}						} else {year = this.getYear(today);}					var month = (values.values[this.USmode?1:2])?this.parseInt(values.values[this.USmode?1:2]):today.getMonth()+1;						if (month > 12)	{month=12;}						if (month < 1)	{month=1;}					var day = (values.values[this.USmode?2:1])?this.parseInt(values.values[this.USmode?2:1]):today.getDate();						if (day > 31)	{day=31;}						if (day < 1)	{day=1;}					if (''+day+'-'+month+'-'+year == "1-1-1970")	{						var theTime = new Date();  theTime.setTime(0);					} else {						var theTime = new Date(parseInt(year), parseInt(month)-1, parseInt(day));					}					this.lastDate = this.getSecs(theTime)			}			this.lastDate+=add*24*60*60;			if (this.lastDate<0) {this.lastDate=0;}			return this.lastDate;		break;		case "time":		case "timesec":			switch (theCmd)	{				case "d":				case "t":				case "n":					var theTime = new Date(this.getYear(today), today.getMonth(), today.getDate(), today.getHours(), today.getMinutes(), ((type=="timesec")?today.getSeconds():0));					this.lastTime = this.getTimeSecs(theTime);					if (values.valPol[1])	{						add = this.pol(values.valPol[1],this.parseInt(values.values[1]));					}				break;				case "+":				case "-":					if (values.valPol[1])	{						add = this.pol(values.valPol[1],this.parseInt(values.values[1]));					}				break;				default:					var index = (type=="timesec")?4:3;					if (values.valPol[index])	{						add = this.pol(values.valPol[index],this.parseInt(values.values[index]));					}					if (values.values[1] && values.values[1].length>2)	{						if (values.valPol[2])	{							add = this.pol(values.valPol[2],this.parseInt(values.values[2]));						}						var temp = values.values[1];						values = new evalFunc_splitSingle(temp);					}					var sec = (values.values[3])?this.parseInt(values.values[3]):today.getSeconds();						if (sec > 59)	{sec=59;}					var min = (values.values[2])?this.parseInt(values.values[2]):today.getMinutes();						if (min > 59)	{min=59;}					var hour = (values.values[1])?this.parseInt(values.values[1]):today.getHours();						if (hour > 23)	{hour=23;}					var theTime = new Date(this.getYear(today), today.getMonth(), today.getDate(), hour, min, ((type=="timesec")?sec:0));					this.lastTime = this.getTimeSecs(theTime)			}			this.lastTime+=add*60;			if (this.lastTime<0) {this.lastTime+=24*60*60;}			return this.lastTime;		break;		default:			return value;	}}
meta: 9100	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/9100/32a890cadc057f29f0886ff71d2b66031a69eec8/jsfunc.evalfield.js/buggy/t3lib/jsfunc.evalfield.js