aboutsummaryrefslogtreecommitdiffstats
path: root/data/lib
diff options
context:
space:
mode:
authorMatěj Cepl <mcepl@redhat.com>2011-06-04 02:30:57 +0200
committerMatěj Cepl <mcepl@redhat.com>2011-06-05 14:53:48 +0200
commitffa6d74ddbf28c7fb7be1ad473847807d0301eac (patch)
treed10ac4afcfeb053567db51462e9695badab875ee /data/lib
parent7509c91794f93a5b4445239429c2b918f771b543 (diff)
downloadbugzilla-triage-ffa6d74ddbf28c7fb7be1ad473847807d0301eac.tar.gz
Moving ahead ... storing the progress for future.
Diffstat (limited to 'data/lib')
-rw-r--r--data/lib/bugzillaDOMFunctions.js20
-rw-r--r--data/lib/bzpage.js2
-rw-r--r--data/lib/util.js25
3 files changed, 46 insertions, 1 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;
+};
diff --git a/data/lib/bzpage.js b/data/lib/bzpage.js
index c1898eb..1be287d 100644
--- a/data/lib/bzpage.js
+++ b/data/lib/bzpage.js
@@ -364,6 +364,8 @@ function completeInit() {
RHBZinit(attachments);
}
+ console.log("completeInit: tweakBugzilla = " + typeof tweakBugzilla);
+ console.log("completeInit: config = " + config.toSource());
if (tweakBugzilla && config.verboseInlineHistory) {
tweakBugzilla(attachments, constantData);
}
diff --git a/data/lib/util.js b/data/lib/util.js
index 02cda2d..f30ddd5 100644
--- a/data/lib/util.js
+++ b/data/lib/util.js
@@ -68,7 +68,7 @@ function parseXMLfromString (inStuff) {
* Get a bug no
*/
function getBugNo() {
- var bugNoElem = document.forms.namedItem('changeform').getElementsByName("id")[0];
+ var bugNoElem = document.forms.namedItem("changeform").elements["id"];
if (bugNoElem) {
return bugNoElem.value;
} else {
@@ -214,6 +214,29 @@ function getISODate(dateStr) {
}
/**
+ * format Date object as ISO-8601 formatted date string
+ *
+ * @param d Date
+ * @return String with date formatted
+ * @url https://developer.mozilla.org/en/JavaScript/Reference\
+ /Global_Objects/Date#Example.3a_ISO_8601_formatted_dates
+ * outputs something like 2009-09-28T19:03:12Z
+ */
+function ISODateString(d) {
+ function pad(n) {
+ return n<10 ? '0'+n : n
+ }
+
+ return d.getUTCFullYear()+'-'
+ + pad(d.getUTCMonth()+1)+'-'
+ + pad(d.getUTCDate())+'T'
+ + pad(d.getUTCHours())+':'
+ + pad(d.getUTCMinutes())+':'
+ + pad(d.getUTCSeconds())+'Z';
+}
+
+
+/**
* Check whether an item is member of the list. Idea is just to make long if
* commands slightly more readable.
*