Skip to content

Instantly share code, notes, and snippets.

@sdepold
Created November 20, 2015 05:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sdepold/d1e5e0e7a66fc77930fe to your computer and use it in GitHub Desktop.
Save sdepold/d1e5e0e7a66fc77930fe to your computer and use it in GitHub Desktop.
formatting dates with jquery.rss
$("#rss-styled").rss("http://www.recruiter.com/feed/career.xml", {
limit: 5,
dateFormatFunction: function (date) {
var realDate = new Date(date);
return realDate.getFullYear() + "-" + (realDate.getMonth() + 1) + "-" + realDate.getDate();
},
layoutTemplate: '<dl class="dl-horizontal">{entries}</dl>',
entryTemplate: '<dt><a href="{url}">{title}</a></dt><dd>{shortBodyPlain}[{author}@{date}]</dd>'
}).show();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment