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

Side by Side Diff: appengine/swarming/ui/res/imp/tasklist/task-list-data.html

Issue 2832423003: Fix Swarming UI timezone bug (Closed)
Patch Set: Fix copy-pasta and use sk.human Created 3 years, 8 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 unified diff | Download patch
OLDNEW
1 <!-- 1 <!--
2 Copyright 2016 The LUCI Authors. All rights reserved. 2 Copyright 2016 The LUCI Authors. All rights reserved.
3 Use of this source code is governed under the Apache License, Version 2.0 3 Use of this source code is governed under the Apache License, Version 2.0
4 that can be found in the LICENSE file. 4 that can be found in the LICENSE file.
5 5
6 This in an HTML Import-able file that contains the definition 6 This in an HTML Import-able file that contains the definition
7 of the following elements: 7 of the following elements:
8 8
9 <bot-list-data> 9 <bot-list-data>
10 10
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 t.tags = t.tags || []; 243 t.tags = t.tags || [];
244 t.tags.forEach(function(tag) { 244 t.tags.forEach(function(tag) {
245 var split = tag.split(":", 1) 245 var split = tag.split(":", 1)
246 var key = split[0]; 246 var key = split[0];
247 var rest = tag.substring(key.length + 1); 247 var rest = tag.substring(key.length + 1);
248 tagMap[key] = rest; 248 tagMap[key] = rest;
249 }); 249 });
250 t.tagMap = tagMap; 250 t.tagMap = tagMap;
251 251
252 TIMES.forEach(function(time) { 252 TIMES.forEach(function(time) {
253 if (t[time]) { 253 swarming.sanitizeAndHumanizeTime(t, time);
254 t[time] = new Date(t[time]);
255 t["human_"+time] = sk.human.localeTime(t[time]);
256 }
257 }); 254 });
258 // Running tasks have no duration set, so we can figure it out. 255 // Running tasks have no duration set, so we can figure it out.
259 if (!t.duration && t.state === this.RUNNING && t.started_ts){ 256 if (!t.duration && t.state === this.RUNNING && t.started_ts){
260 t.duration = (now - t.started_ts) / 1000; 257 t.duration = (now - t.started_ts) / 1000;
261 } 258 }
262 // Make the duration human readable 259 // Make the duration human readable
263 if (t.duration){ 260 if (t.duration){
264 t.human_duration = this._humanDuration(t.duration); 261 t.human_duration = this._humanDuration(t.duration);
265 } 262 }
266 }.bind(this)); 263 }.bind(this));
267 return json.items; 264 return json.items;
268 } 265 }
269 }); 266 });
270 })(); 267 })();
271 </script> 268 </script>
272 </dom-module> 269 </dom-module>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698