blog.depold.com |
Web programming to the rescue! A blog about Node.JS, JavaScript and Ruby on Rails! |
multiracial asked: Hello! I'm taking a look at your jquery-rss and I was wondering if I could get a little help in altering the {date} so that it just shows Month, day, and year. Thanks for any help you can provide!
Hey there. The correct way is to take the already available date and transform it the way you need it:
$(“#rss-feeds”).rss(“http://feeds.feedburner.com/dawanda”, {
limit: 15,
template: ‘{date2}: {title}’,
tokens: {
date2: function(entry, tokens){
var date = new Date(Date.parse(tokens.date))
return [date.getFullYear(), date.getMonth() + 1, date.getDay()].join(“-“)
}
}
})
Let me know if that helps :)