RSS フィードから publishedDate を解析しようとしていますが、成功しません...
このコードを使用して日付を表示できます: thefeeds[i].publishedDate
.. 結果は次のとおりですSat, 02 Feb 2013 22:00:00 -0800
。
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type="text/javascript">
var feedcontainer=document.getElementById("feeddiv")
var feedurl="http://feeds.folha.uol.com.br/folha/classificados/empregos/rss091.xml"
var feedlimit=4
var rssoutput="<ul>"
function rssfeedsetup(){
var feedpointer=new google.feeds.Feed(feedurl) //Google Feed API method
feedpointer.setNumEntries(feedlimit) //Google Feed API method
feedpointer.load(displayfeed) //Google Feed API method
}
function displayfeed(result){
if (!result.error){
var thefeeds=result.feed.entries
for (var i=0; i<thefeeds.length; i++){
<!-- I THINK I'M DOING THIS LINES WRONG!! -->
var pubDate = thefeeds[i].publishedDate
var date = new Date(pubDate);
var months = Array("Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro");
var string = date.getDate() + " " + months[date.getMonth()] + " " + date.getFullYear()
<!-- END -->
rssoutput+="<li><span>•</span> " + string + " - <a href='" + thefeeds[i].link + "' target='_blank'>" + thefeeds[i].title + "</a></li>"
rssoutput+="</ul>"
feedcontainer.innerHTML=rssoutput
}
else
alert("Erro ao carregar as notícias!")
}
window.onload=function(){
rssfeedsetup()
}
</script>
どうしたの?