Add hour when the value was taken on index page

This commit is contained in:
Chteufleur 2015-09-29 21:18:18 +02:00
parent 049734f8a3
commit bd957fd394
2 changed files with 4 additions and 1 deletions

View File

@ -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)
}

View File

@ -10,7 +10,7 @@
</div>
<div class="panel-body">
<div class="form-group">
<p>{{$val.Value}} {{$val.Unit}}</p>
<p><strong>{{$val.Horodate}} :</strong> {{$val.Value}} {{$val.Unit}}</p>
</div>
</div>
</div>