/    Sign up×
Community /Pin to ProfileBookmark

[HELP!] Internet Explorer vs Twitter Plugin

Hi, Im using a twitter plugin to get a twitter feed working on my website. It works great on all browsers but on Internet Explorer the post date displays as “NaN days ago”. Has anyone else had this problem? My code where the date is being drawn from is:

[CODE]function twitter_time_since(datetime)
{
var tTime=new Date(datetime);
var cTime=new Date();
var sinceMin=Math.round((cTime-tTime)/60000);
if(sinceMin==0)
{
var sinceSec=Math.round((cTime-tTime)/1000);
if(sinceSec<10)
var since=’less than 10 seconds ago’;
else if(sinceSec<20)
var since=’less than 20 seconds ago’;
else
var since=’half a minute ago’;
}
else if(sinceMin==1)
{
var sinceSec=Math.round((cTime-tTime)/1000);
if(sinceSec==30)
var since=’half a minute ago’;
else if(sinceSec<60)
var since=’less than a minute ago’;
else
var since=’1 minute ago’;
}
else if(sinceMin<45)
var since=sinceMin+’ minutes ago’;
else if(sinceMin>44 && sinceMin<60)
var since=’about 1 hour ago’;
else if(sinceMin<1440){
var sinceHr=Math.round(sinceMin/60);
if(sinceHr==1)
var since=’about 1 hour ago’;
else
var since=’about ‘+sinceHr+’ hours ago’;
}
else if(sinceMin>1439 && sinceMin<2880)
var since=’1 day ago’;
else
{
var sinceDay=Math.round(sinceMin/1440);
var since=sinceDay+’ days ago’;
}
return since;
};[/CODE]

to post a comment
JavaScript

0Be the first to comment 😎

×

Success!

Help @alfa87 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...