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

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

Issue 473433002: Fix test for "last updated" text. (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
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 <template if="{{ date }}"> 9 <template if="{{ date }}">
10 Updated {{ date | _deltaMinutes }} min ago @ {{ date | _hours }}:{{ date | _minutes }} 10 Updated {{ date | _deltaMinutes }} min ago @ {{ date | _hours }}:{{ date | _minutes }}
11 </template> 11 </template>
12 </template> 12 </template>
13 <script> 13 <script>
14 (function() { 14 (function() {
15 Polymer({ 15 Polymer({
16 date: null, 16 date: null,
17 17
18 _deltaMinutes: function(date) { 18 _deltaMinutes: function(date) {
19 return date.minutesAgo(); 19 return date.minutesAgo();
20 }, 20 },
21 _hours: function(date) { 21 _hours: function(date) {
22 return date.getHours(); 22 return date.getHours();
23 }, 23 },
24 _minutes: function(date) { 24 _minutes: function(date) {
25 var s = date.getMinutes().toString(); 25 return date.getMinutes().toString().padLeft(2, '0');
26 if (s.length == 1)
27 s = "0" + s;
28 return s;
29 }, 26 },
30 }); 27 });
31 })(); 28 })();
32 29
33 </script> 30 </script>
34 </polymer-element> 31 </polymer-element>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698