Index: Tools/GardeningServer/ui/ct-last-updated.html |
diff --git a/Tools/GardeningServer/ui/ct-last-updated.html b/Tools/GardeningServer/ui/ct-last-updated.html |
index e2e832bd9ac494f9d80713f80b37ea2ed72125fa..077952bf7fdd1ee2f2f1e05cf2ef39d7f28215ae 100644 |
--- a/Tools/GardeningServer/ui/ct-last-updated.html |
+++ b/Tools/GardeningServer/ui/ct-last-updated.html |
@@ -6,12 +6,19 @@ found in the LICENSE file. |
<polymer-element name="ct-last-updated" attributes="date"> |
<template> |
- Updated {{ date | _deltaMinutes }} min ago @ {{ date | _hours }}:{{ date | _minutes }} |
+ <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.
|
+ Updated {{ date | _deltaMinutes }} min ago @ {{ date | _hours }}:{{ date | _minutes }} |
+ </template> |
</template> |
<script> |
(function() { |
Polymer({ |
date: new Date(0), |
+ visible: false, |
+ |
+ dateChanged: function() { |
+ this.visible = true; |
+ }, |
_deltaMinutes: function(date) { |
return date.minutesAgo(); |
@@ -20,7 +27,10 @@ found in the LICENSE file. |
return date.getHours(); |
}, |
_minutes: function(date) { |
- return date.getMinutes(); |
+ 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.
|
+ if (s.length == 1) |
+ s = "0" + s; |
+ return s; |
}, |
}); |
})(); |