Add question marks to coffee in case of few errors

This commit is contained in:
Ilkka Oksanen
2017-11-01 13:39:46 +02:00
parent 2f80159144
commit e0e73976db
2 changed files with 9 additions and 5 deletions
+8 -4
View File
@@ -99,10 +99,14 @@ function updateBrewDiff(){
}
function updateBrewTime(ev){
var timeDiff = ev.detail;
var timeStr = (timeDiff < 3600000)
? Math.round(timeDiff / 60000) + ' min'
: '~' + Math.round(timeDiff / 3600000 * 2) / 2 + ' h';
var timeStr;
if (timeDiff < 3600000){
timeStr = Math.round(timeDiff / 60000) + ' min'
} else if (timeDiff < 10000* 3600 * 1000){ // 1000h
timeStr = '~' + Math.round(timeDiff / 3600000 * 2) / 2 + ' h';
} else {
timeStr = "???"
}
$("#brewtime").html(timeStr);
}
+1 -1
View File
@@ -29,7 +29,7 @@
</div>
<!--Kahvinkeitin on rikki. Varakeittimellä keitettyä kahvia saattaa olla.-->
<div id="lower" class="normal">
<div id="text" class="text layerone"></div>
<div id="text" class="text layerone">???</div>
<div class="text layertwo">&nbsp;+</div>
<div id="scale"><div id="scale2"></div></div>
</div>