Skip to content

Commit

Permalink
patched to handle dc:date apparently correctly while maintaining prev…
Browse files Browse the repository at this point in the history
…ious code. seems to work.
  • Loading branch information
rbrcurtis committed May 15, 2013
1 parent 8488c4e commit d0966c1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
3 changes: 2 additions & 1 deletion main.js
Original file line number Diff line number Diff line change
Expand Up @@ -731,7 +731,8 @@ FeedParser.prototype.handleItem = function handleItem (node, type, options){
case('modified'):
case('updated'):
case('dc:date'):
var date = utils.get(el) ? new Date(el['#']) : null;
var date, _ref, _ref2, _ref3, _ref4;
date = (_ref = (_ref2 = (_ref3 = utils.get(el)) != null ? _ref3 : new Date((_ref4 = el[0]) != null ? _ref4['#'] : void 0)) != null ? _ref2 : new Date(el['#'])) != null ? _ref : null;
if (!date) break;
if (item.pubdate === null || name == 'pubdate' || name == 'published' || name == 'issued')
item.pubdate = item.pubDate = date;
Expand Down

0 comments on commit d0966c1

Please sign in to comment.