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

Side by Side Diff: Tools/GardeningServer/ui/ct-last-updated.html

Issue 453543002: Add last update time to Sheriff-O-Matic. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 <!--
2 Copyright 2014 The Chromium Authors. All rights reserved.
3 Use of this source code is governed by a BSD-style license that can be
4 found in the LICENSE file.
5 -->
6
7 <polymer-element name="ct-last-updated" attributes="date">
ojan 2014/08/08 06:05:13 Please add a test for this. It's confusing because
teravest 2014/08/08 22:21:28 Done.
8 <template>
9 <style>
10 :host {
11 display: flex;
ojan 2014/08/08 06:05:13 I don't think you need this element to be a flexbo
teravest 2014/08/08 22:21:28 Removed.
12 }
13
14 .message {
15 flex: 1;
16 overflow: hidden;
17 text-overflow: ellipsis;
18 white-space: nowrap;
ojan 2014/08/08 06:05:12 It's tricky deciding where to put which CSS stylin
teravest 2014/08/08 22:21:28 I've removed the styling here.
19 }
20
21 </style>
22 <div class="message">Updated {{ delta_min }} min ago @ {{ date_hours }}:{{ d ate_minutes }}.</div>
ojan 2014/08/08 06:05:12 I don't think this wrapper div is needed.
teravest 2014/08/08 22:21:28 Removed.
23 </template>
24 <script>
25 (function() {
26 Polymer({
27 date: 0, // seconds from epoch
28 delta_min: 0,
29 date_hours: 0,
30 date_minutes: 0,
31
32 dateChanged: function() {
33 this.update();
34 },
35
36 update: function() {
ojan 2014/08/08 06:05:13 You don't need the update function. Better is to l
teravest 2014/08/08 22:21:28 That's much better, thanks!
37 this.delta_min = Math.floor(((Date.now() / 1000) - this.date) / 60);
38 this.date_hours = new Date(this.date * 1000).getHours();
39 this.date_minutes = new Date(this.date * 1000).getMinutes();
ojan 2014/08/08 06:05:12 sugarjs, which we include, has nice methods to get
teravest 2014/08/08 22:21:27 Excellent. Done.
40 },
41
42 });
43 })();
44
45 </script>
46 </polymer-element>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698