aboutsummaryrefslogtreecommitdiffstats
path: root/data/lib/bugzillaDOMFunctions.js
diff options
context:
space:
mode:
Diffstat (limited to 'data/lib/bugzillaDOMFunctions.js')
-rw-r--r--data/lib/bugzillaDOMFunctions.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/data/lib/bugzillaDOMFunctions.js b/data/lib/bugzillaDOMFunctions.js
index 8f74288..49afef5 100644
--- a/data/lib/bugzillaDOMFunctions.js
+++ b/data/lib/bugzillaDOMFunctions.js
@@ -456,3 +456,23 @@ function getBugzillaName(URLhostname, bzLabelNames) {
}
return bugzillaID;
}
+
+/**
+ *
+ * original 2011-03-30 15:49:27 EDT
+ */
+function parseBZCommentDate(dateString) {
+ var tZone = {
+ "EDT": 4,
+ "EST": 5
+ };
+
+ var dateArr = dateString.trim().split(/\s+/);
+ var timeZoneOffset = tZone[dateArr[2]] -
+ ((new Date()).getTimezoneOffset())/60;
+ var dArr = dateArr[0].split("-");
+ var tArr = dateArr[1].split(":");
+ var dayObj = new Date(+dArr[0],+dArr[1]-1,+dArr[2],
+ +tArr[0]+timeZoneOffset,+tArr[1],+tArr[2],0);
+ return dayObj;
+};