[FIX] website_twitter: IE does not accept twitter date format
Datetime like Tue Jul 13 23:18:36 +0000 2010 is not accepted by IE and return "Invalid date". Therefore, We parse the date to a format known by IE (and other browsers) Trick took from http://stackoverflow.com/questions/3243546/problem-with-javascript-date-function-in-ie-7-returns-nan
This commit is contained in:
parent
e55098263b
commit
1d77697a5d
|
@ -61,7 +61,9 @@
|
|||
function (hashtag) { return create_link("http://twitter.com/search?q="+hashtag.replace("#",""), hashtag); });
|
||||
},
|
||||
parse_date: function(tweet) {
|
||||
var d = new Date(tweet.created_at);
|
||||
if (_.isEmpty(tweet.created_at)) return "";
|
||||
var v = tweet.created_at.split(' ');
|
||||
var d = new Date(Date.parse(v[1]+" "+v[2]+", "+v[5]+" "+v[3]+" UTC"));
|
||||
return d.toDateString();
|
||||
},
|
||||
setupMouseEvents: function() {
|
||||
|
|
Loading…
Reference in New Issue