Bug 934241 - Feeds should support the received date, ie store a Received trace header. r=alta88
authoralta88@gmail.com
Fri, 08 Nov 2013 14:37:26 -0700
changeset 15024 976e600de09920b5d9e52f1e8c29ab9836cc567f
parent 15023 eda1ae45ed6f740f4b2331030e31d3e670eb81d9
child 15025 f7c79b0b1901e40f0bebed92eb89864942eb1393
push id1120
push userbugzilla@standard8.plus.com
push dateMon, 09 Dec 2013 20:34:13 +0000
treeherdercomm-aurora@c76f297f259d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersalta88
bugs934241
Bug 934241 - Feeds should support the received date, ie store a Received trace header. r=alta88
mailnews/extensions/newsblog/content/utils.js
--- a/mailnews/extensions/newsblog/content/utils.js
+++ b/mailnews/extensions/newsblog/content/utils.js
@@ -736,19 +736,19 @@ var FeedUtils = {
  * @param  [string] aDateString - optional date string; if null or invalid
  *                                 date, get the current datetime.
  * @return string               - an rfc5322 date string
  */
   getValidRFC5322Date: function(aDateString)
   {
     let d = new Date(aDateString || new Date().getTime());
     d = isNaN(d.getTime()) ? new Date() : d;
-    let utcDate = d.toUTCString();
-    let tzOffset = d.toTimeString().split("GMT")[1].split(" ")[0];
-    return utcDate.replace(/GMT/, tzOffset);
+    let rfcDate = d.toUTCString().split(" ").slice(0,4).join(" ");
+    let rfcTimeLocal = d.toTimeString().split(" ").slice(0,2).join(" ");
+    return rfcDate + " " + rfcTimeLocal.replace(/GMT/,"");
   },
 
   // Progress glue code.  Acts as a go between the RSS back end and the mail
   // window front end determined by the aMsgWindow parameter passed into
   // nsINewsBlogFeedDownloader.
   progressNotifier: {
     mSubscribeMode: false,
     mMsgWindow: null,