From bd957fd3949433dc5e75abb3c432c2a84b37d0ec Mon Sep 17 00:00:00 2001 From: Chteufleur Date: Tue, 29 Sep 2015 21:18:18 +0200 Subject: [PATCH] Add hour when the value was taken on index page --- controllers/default.go | 3 +++ views/index.tpl | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/controllers/default.go b/controllers/default.go index 43cec72..62c5d67 100644 --- a/controllers/default.go +++ b/controllers/default.go @@ -13,6 +13,7 @@ type SensorPrint struct { Name string Value string Unit string + Horodate string } type MainController struct { @@ -40,6 +41,8 @@ func getLastTemps() ([]SensorPrint) { sens.Value = strconv.FormatInt(t.Value, 10) sens.Unit = "°C" + sens.Horodate = t.HorodateGMT.Format("04h05") + values = append(values, *sens) } diff --git a/views/index.tpl b/views/index.tpl index 35739dc..b331abc 100644 --- a/views/index.tpl +++ b/views/index.tpl @@ -10,7 +10,7 @@
-

{{$val.Value}} {{$val.Unit}}

+

{{$val.Horodate}} : {{$val.Value}} {{$val.Unit}}