prettyDate not working in IE

By far the simplest way of parsing dates from the twitter API is to use John Resig’s prettydate script. I found that this tended to have problems in IE when parsing twitter style dates. Fix was very simple though. Just add the following line to the start of the script…

function prettyDate(time) {
    time = time.replace("+0000", "");
    ... and so on

Basically the IE javascript engine was struggling with the “+0000” part of the date that twitter returns, so just get rid of it before parsing the date.


2 thoughts on “prettyDate not working in IE

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s