bundles/org.eclipse.orion.client.ui/web/orion/uiUtils.js
function timeElapsed(timeStamp) {
		var diff = _timeDifference(timeStamp);
		var yearStr = _generateTimeString(diff.year, "a year", "years");
		var monthStr = _generateTimeString(diff.month, "a month", "months");
		var dayStr = _generateTimeString(diff.day, "a day", "days");
		var hourStr = _generateTimeString(diff.hour, "an hour", "hours");
		var minuteStr = _generateTimeString(diff.minute, "a minute", "minutes");
		var disPlayStr = "";
		if(yearStr) {
			disPlayStr = diff.year > 0 ? yearStr : yearStr + monthStr;
		} else if(monthStr) {
			disPlayStr = diff.month > 0 ? monthStr : monthStr + dayStr;
		} else if(dayStr) {
			disPlayStr = diff.day > 0 ? dayStr : dayStr + hourStr;
		} else if(hourStr) {
			disPlayStr = diff.hour > 0 ? hourStr : hourStr + minuteStr;
		} else if(minuteStr) {
			disPlayStr = minuteStr;
		}
		return disPlayStr;	
	}
function timeElapsed(timeStamp) {
		var diff = _timeDifference(timeStamp);
		var yearStr = _generateTimeString(diff.year, "a year", "years");
		var monthStr = _generateTimeString(diff.month, "a month", "months");
		var dayStr = _generateTimeString(diff.day, "a day", "days");
		var hourStr = _generateTimeString(diff.hour, "an hour", "hours");
		var minuteStr = _generateTimeString(diff.minute, "a minute", "minutes");
		var disPlayStr = "";
		if(yearStr) {
			disPlayStr = diff.year > 0 ? yearStr : yearStr + monthStr;
		} else if(monthStr) {
			disPlayStr = diff.month > 0 ? monthStr : monthStr + dayStr;
		} else if(dayStr) {
			disPlayStr = diff.day > 0 ? dayStr : dayStr + hourStr;
		} else if(hourStr) {
			disPlayStr = diff.hour > 0 ? hourStr : hourStr + minuteStr;
		} else if(minuteStr) {
			disPlayStr = minuteStr;
		}
		return disPlayStr;	
	}
function timeElapsed ( timeStamp ) { var diff = _timeDifference ( timeStamp ) ; var yearStr = _generateTimeString ( diff . year , "a year" , "years" ) ; var monthStr = _generateTimeString ( diff . month , "a month" , "months" ) ; var dayStr = _generateTimeString ( diff . day , "a day" , "days" ) ; var hourStr = _generateTimeString ( diff . hour , "an hour" , "hours" ) ; var minuteStr = _generateTimeString ( diff . minute , "a minute" , "minutes" ) ; var disPlayStr = "" ; if ( yearStr ) { disPlayStr = diff . year > 0 ? yearStr : yearStr + monthStr ; } else if ( monthStr ) { disPlayStr = diff . month > 0 ? monthStr : monthStr + dayStr ; } else if ( dayStr ) { disPlayStr = diff . day > 0 ? dayStr : dayStr + hourStr ; } else if ( hourStr ) { disPlayStr = diff . hour > 0 ? hourStr : hourStr + minuteStr ; } else if ( minuteStr ) { disPlayStr = minuteStr ; } return disPlayStr ; }
Returns the time duration passed by now. E.g. "2 minutes", "an hour", "a day", "3 months", "2 years"
@param {String} timeStamp
@returns {String} If the duration is less than 1 minute, it returns empty string "". Otherwise it returns a duration value.
Returns the time duration passed by now . E . g . 2 minutes an hour a day 3 months 2 years