Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1009)

Unified Diff: appengine/swarming/elements/res/imp/tasklist/task-list-data.html

Issue 2338383002: Refactor prior to adding task-page (Closed) Base URL: git@github.com:luci/luci-py@master
Patch Set: Address nits Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: appengine/swarming/elements/res/imp/tasklist/task-list-data.html
diff --git a/appengine/swarming/elements/res/imp/tasklist/task-list-data.html b/appengine/swarming/elements/res/imp/tasklist/task-list-data.html
index 4eeaee2dbfb0b88348994fd18fc60dd8bdfb0bd2..103c19255869b9097791636b1a9e2be3fb6b4f35 100644
--- a/appengine/swarming/elements/res/imp/tasklist/task-list-data.html
+++ b/appengine/swarming/elements/res/imp/tasklist/task-list-data.html
@@ -216,16 +216,12 @@
if (!this._list || !this._list.items) {
return [];
}
- // Date.toString() looks like "Mon Aug 29 2016 09:03:41 GMT-0400 (EDT)"
- // we want to extract the time zone part and append it to the
- // locale time.
var now = new Date();
- var str = now.toString();
- var timeZone = str.substring(str.indexOf("("))
// Do any preprocessing here
this._list.items.forEach(function(t) {
var tagMap = {};
+ t.tags = t.tags || [];
t.tags.forEach(function(tag) {
var split = tag.split(":", 1)
var key = split[0];
@@ -233,11 +229,11 @@
tagMap[key] = rest;
});
t.tagMap = tagMap;
+
TIMES.forEach(function(time) {
if (t[time]) {
t[time] = new Date(t[time]);
- var locale = t[time].toLocaleString();
- t["human_"+time] = locale + " " + timeZone;
+ t["human_"+time] = sk.human.localeTime(t[time]);
}
});
// Running tasks have no duration set, so we can figure it out.
@@ -246,9 +242,9 @@
}
// Make the duration human readable
if (t.duration){
- t.human_duration = sk.human.strDuration(t.duration);
+ t.human_duration = this._humanDuration(t.duration);
}
- });
+ }.bind(this));
return this._list.items;
}
});
« no previous file with comments | « appengine/swarming/elements/res/imp/tasklist/task-list.html ('k') | appengine/swarming/elements/res/js/common.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698