[Pkg-mozext-commits] [sage-extension] 35/39: date parsing fix
David Prévot
taffit at moszumanska.debian.org
Fri May 1 03:10:22 UTC 2015
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to tag sage_1_1
in repository sage-extension.
commit 4b53b53237d949fd09bff393f79ffa4dfd51eda7
Author: Peter Andrews <petea at jhu.edu>
Date: Fri Jun 11 02:54:21 2004 +0000
date parsing fix
---
src/sage/content/feedlib.js | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/src/sage/content/feedlib.js b/src/sage/content/feedlib.js
index 05b4fbf..997296b 100644
--- a/src/sage/content/feedlib.js
+++ b/src/sage/content/feedlib.js
@@ -71,7 +71,10 @@ Feed.prototype.parseRSS = function() {
item.content = CommonFunc.getInnerText(j);
break;
case "pubDate":
- item.pubDate = new Date(CommonFunc.getInnerText(j));
+ tmp_date = new Date(CommonFunc.getInnerText(j));
+ if(tmp_date != "Invalid Date") {
+ item.pubDate = tmp_date;
+ }
break;
case "date":
tmp_str = CommonFunc.getInnerText(j);
@@ -82,7 +85,10 @@ Feed.prototype.parseRSS = function() {
tmp_date.setUTCHours(tmp_str.substring(11,13));
tmp_date.setUTCMinutes(tmp_str.substring(14,16));
tmp_date.setUTCSeconds(tmp_str.substring(17,19));
- item.pubDate = new Date(tmp_date);
+ tmp_date = new Date(tmp_date);
+ if(tmp_date != "Invalid Date") {
+ item.pubDate = tmp_date;
+ }
break;
}
}
@@ -155,7 +161,10 @@ Feed.prototype.parseATOM = function() {
tmp_date.setUTCHours(tmp_str.substring(11,13));
tmp_date.setUTCMinutes(tmp_str.substring(14,16));
tmp_date.setUTCSeconds(tmp_str.substring(17,19));
- item.pubDate = new Date(tmp_date);
+ tmp_date = new Date(tmp_date);
+ if(tmp_date != "Invalid Date") {
+ item.pubDate = tmp_date;
+ }
}
var aEntryNode = entryNodes[i];
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/sage-extension.git
More information about the Pkg-mozext-commits
mailing list