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

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

Issue 466783002: Hide last updated data until date is populated. (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
« no previous file with comments | « no previous file | Tools/GardeningServer/ui/test/ct-last-updated-tests.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!-- 1 <!--
2 Copyright 2014 The Chromium Authors. All rights reserved. 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 3 Use of this source code is governed by a BSD-style license that can be
4 found in the LICENSE file. 4 found in the LICENSE file.
5 --> 5 -->
6 6
7 <polymer-element name="ct-last-updated" attributes="date"> 7 <polymer-element name="ct-last-updated" attributes="date">
8 <template> 8 <template>
9 Updated {{ date | _deltaMinutes }} min ago @ {{ date | _hours }}:{{ date | _ minutes }} 9 <template if="{{ visible }}">
ojan 2014/08/12 21:27:05 How about instead of adding a separate property, y
teravest 2014/08/12 21:30:04 Much better, thanks.
10 Updated {{ date | _deltaMinutes }} min ago @ {{ date | _hours }}:{{ date | _minutes }}
11 </template>
10 </template> 12 </template>
11 <script> 13 <script>
12 (function() { 14 (function() {
13 Polymer({ 15 Polymer({
14 date: new Date(0), 16 date: new Date(0),
17 visible: false,
18
19 dateChanged: function() {
20 this.visible = true;
21 },
15 22
16 _deltaMinutes: function(date) { 23 _deltaMinutes: function(date) {
17 return date.minutesAgo(); 24 return date.minutesAgo();
18 }, 25 },
19 _hours: function(date) { 26 _hours: function(date) {
20 return date.getHours(); 27 return date.getHours();
21 }, 28 },
22 _minutes: function(date) { 29 _minutes: function(date) {
23 return date.getMinutes(); 30 var s = date.getMinutes() + "";
ojan 2014/08/12 21:27:05 Nit: date.getMinutes().toString() is more idiomati
teravest 2014/08/12 21:30:04 Done.
31 if (s.length == 1)
32 s = "0" + s;
33 return s;
24 }, 34 },
25 }); 35 });
26 })(); 36 })();
27 37
28 </script> 38 </script>
29 </polymer-element> 39 </polymer-element>
OLDNEW
« no previous file with comments | « no previous file | Tools/GardeningServer/ui/test/ct-last-updated-tests.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698