(function(e){functionn(){vart=r(this);if(!isNaN(t.datetime)){e(this).text(i(t.datetime))}returnthis}functionr(n){n=e(n);if(!n.data("timeago")){n.data("timeago",{datetime:t.datetime(n)});varr=e.trim(n.text());if(r.length>0&&!(t.isTime(n)&&n.attr("title"))){n.attr("title",r)}}returnn.data("timeago")}functioni(e){returnt.inWords(s(e))}functions(e){return(newDate).getTime()-e.getTime()}e.timeago=function(t){if(tinstanceofDate){returni(t)}elseif(typeoft==="string"){returni(e.timeago.parse(t))}elseif(typeoft==="number"){returni(newDate(t))}else{returni(e.timeago.datetime(t))}};vart=e.timeago;e.extend(e.timeago,{settings:{refreshMillis:6e4,allowFuture:false,strings:{prefixAgo:null,prefixFromNow:null,suffixAgo:"ago",suffixFromNow:"from now",seconds:"less than a minute",minute:"about a minute",minutes:"%d minutes",hour:"about an hour",hours:"about %d hours",day:"a day",days:"%d days",month:"about a month",months:"%d months",year:"about a year",years:"%d years",wordSeparator:" ",numbers:[]}},inWords:function(t){functionl(r,i){vars=e.isFunction(r)?r(i,t):r;varo=n.numbers&&n.numbers[i]||i;returns.replace(/%d/i,o)}varn=this.settings.strings;varr=n.prefixAgo;vari=n.suffixAgo;if(this.settings.allowFuture){if(t<0){r=n.prefixFromNow;i=n.suffixFromNow}}vars=Math.abs(t)/1e3;varo=s/60;varu=o/60;vara=u/24;varf=a/365;varc=s<45&&l(n.seconds,Math.round(s))||s<90&&l(n.minute,1)||o<45&&l(n.minutes,Math.round(o))||o<90&&l(n.hour,1)||u<24&&l(n.hours,Math.round(u))||u<42&&l(n.day,1)||a<30&&l(n.days,Math.round(a))||a<45&&l(n.month,1)||a<365&&l(n.months,Math.round(a/30))||f<1.5&&l(n.year,1)||l(n.years,Math.round(f));varh=n.wordSeparator===undefined?" ":n.wordSeparator;returne.trim([r,c,i].join(h))},parse:function(t){varn=e.trim(t);n=n.replace(/\.\d+/,"");n=n.replace(/-/,"/").replace(/-/,"/");n=n.replace(/T/," ").replace(/Z/," UTC");n=n.replace(/([\+\-]\d\d)\:?(\d\d)/," $1$2");returnnewDate(n)},datetime:function(n){varr=t.isTime(n)?e(n).attr("datetime"):e(n).attr("title");returnt.parse(r)},isTime:function(t){returne(t).get(0).tagName.toLowerCase()==="time"}});e.fn.timeago=function(){vare=this;e.each(n);varr=t.settings;if(r.refreshMillis>0){setInterval(function(){e.each(n)},r.refreshMillis)}returne};document.createElement("abbr");document.createElement("time")})(jQuery)