Permalink
Browse files

Fix date parsing.

Don't trust that the dates are not arrays.
  • Loading branch information...
1 parent e229eae commit 10dd366d103e83111f70586798f7fcd6a6f76f73 @danmactough committed Jun 4, 2013
Showing with 2 additions and 2 deletions.
  1. +2 −2 main.js
View
@@ -434,7 +434,7 @@ FeedParser.prototype.handleMeta = function handleMeta (node, type, options) {
case('modified'):
case('updated'):
case('dc:date'):
- var date = utils.get(el) ? new Date(el['#']) : null;
+ var date = utils.get(el) ? new Date(utils.get(el)) : null;
if (!date) break;
if (meta.pubdate === null || name == 'pubdate' || name == 'published')
meta.pubdate = meta.pubDate = date;
@@ -731,7 +731,7 @@ 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 = utils.get(el) ? new Date(utils.get(el)) : null;
if (!date) break;
if (item.pubdate === null || name == 'pubdate' || name == 'published' || name == 'issued')
item.pubdate = item.pubDate = date;

0 comments on commit 10dd366

Please sign in to comment.