[Bug fix] Print horodat in index like 09h00

This commit is contained in:
Chteufleur 2015-10-06 20:18:48 +02:00
parent 087c384f1f
commit d3a366a1b7
2 changed files with 11 additions and 3 deletions

View File

@ -52,7 +52,15 @@ func getLastTemps() ([]SensorPrint) {
horodatTmp := t.HorodateGMT
horodatTmp = horodatTmp.Add(time.Duration(timezoneOffset)*time.Second)
h, m, _ := horodatTmp.Clock()
sens.Horodate = strconv.Itoa(h)+"h"+strconv.Itoa(m)
hStr := strconv.Itoa(h)
if h < 10 {
hStr = "0"+hStr
}
mStr := strconv.Itoa(m)
if m < 10 {
mStr = "0"+mStr
}
sens.Horodate = hStr+"h"+mStr
values = append(values, *sens)
}

View File

@ -17,11 +17,11 @@
class="active"
{{end}}
><a href="/view/temp">Temperatures</a></li>
<li
<!-- <li
{{if .IsViewElec}}
class="active"
{{end}}
><a href="/view/elec">Consommation electrique</a></li>
><a href="/view/elec">Consommation electrique</a></li> -->
</ul>
<ul class="nav navbar-nav navbar-right">
<li