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

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

Issue 2289723003: Make times easier to read on task list (Closed) Base URL: https://chromium.googlesource.com/external/github.com/luci/luci-py@master
Patch Set: Typo Created 4 years, 4 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
« no previous file with comments | « appengine/swarming/elements/res/imp/tasklist/task-list.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 7c8f521533c8679301fe50980610cff9fdccf438..d393ac7dbb64b3ba394627e8c0b77bd2778232a5 100644
--- a/appengine/swarming/elements/res/imp/tasklist/task-list-data.html
+++ b/appengine/swarming/elements/res/imp/tasklist/task-list-data.html
@@ -45,6 +45,7 @@
<dom-module id="task-list-data">
<script>
(function(){
+ var TIMES = ["abandoned_ts", "completed_ts", "created_ts", "modified_ts", "started_ts"];
Polymer({
is: 'task-list-data',
@@ -209,15 +210,13 @@
pMap["state"] = ["PENDING", "RUNNING", "PENDING_RUNNING", "COMPLETED",
"COMPLETED_SUCCESS","COMPLETED_FAILURE", "EXPIRED", "TIMED_OUT",
"BOT_DIED", "CANCELED", "ALL", "DEDUPED"];
- pMap["abandoned_ts"] = [];
- pMap["completed_ts"] = [];
pMap["costs_usd"] = [];
- pMap["created_ts"] = [];
pMap["deduped_from"] = [];
pMap["duration"] = [];
- pMap["modified_ts"] = [];
pMap["server_versions"] = [];
- pMap["started_ts"] = [];
+ TIMES.forEach(function(t) {
+ pMap[t] = [];
+ });
return pMap;
},
@@ -235,6 +234,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 str = (new Date()).toString();
+ var timeZone = str.substring(str.indexOf("("))
+
// Do any preprocessing here
this._list.items.forEach(function(t) {
var tagMap = {};
@@ -245,6 +250,13 @@
tagMap[key] = rest;
});
t.tagMap = tagMap;
+ TIMES.forEach(function(time) {
+ if (t[time]) {
+ var d = new Date(t[time]);
+ var locale = d.toLocaleString();
+ t["human_"+time] = locale + " " + timeZone;
+ }
+ });
});
return this._list.items;
}
« no previous file with comments | « appengine/swarming/elements/res/imp/tasklist/task-list.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698