Chromium Code Reviews| 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..7138dd57d9e8c61241272050fc6787ed36759bca 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; |
| }, |
| @@ -245,6 +244,18 @@ |
| tagMap[key] = rest; |
| }); |
| t.tagMap = tagMap; |
| + TIMES.forEach(function(time) { |
| + if (t[time]) { |
| + var d = new Date(t[time]); |
| + // d.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 = d.toString(); |
| + var timeZone = str.substring(str.indexOf("(")) |
|
jcgregorio
2016/08/29 13:28:14
The timezone is always going to be the same, extra
kjlubick
2016/08/29 13:36:49
But what if this code had been running at a partic
|
| + var locale = d.toLocaleString(); |
| + t["human_"+time] = locale + " " + timeZone; |
| + } |
| + }); |
| }); |
| return this._list.items; |
| } |