added days closed

This commit is contained in:
Timm 2015-04-17 20:45:09 +02:00
parent c26f342416
commit 0c01ba9160

View File

@ -51,6 +51,7 @@ layout: default
//DA FOO!! //DA FOO!!
//needs to be refactored! soon! //needs to be refactored! soon!
//smells like the shit this one guy took that forced british airways to fly back home. //smells like the shit this one guy took that forced british airways to fly back home.
var statisticSince = moment.unix(data[0].value.lastchange);
var hourStart = moment.unix(data[0].value.lastchange); var hourStart = moment.unix(data[0].value.lastchange);
var dayStart = moment.unix(data[0].value.lastchange); var dayStart = moment.unix(data[0].value.lastchange);
var openTimeArrayIndex = 0; var openTimeArrayIndex = 0;
@ -61,6 +62,7 @@ layout: default
var dayCountCurrent = 0; var dayCountCurrent = 0;
var dayCountCurrentStart = dayStart.clone(); var dayCountCurrentStart = dayStart.clone();
var dayCountCurrentEnd = dayStart.clone(); var dayCountCurrentEnd = dayStart.clone();
var dayCountClosed = 0;
var wasOpen = null; var wasOpen = null;
while(hourStart < moment()) { while(hourStart < moment()) {
@ -80,6 +82,7 @@ layout: default
} else { } else {
dayCountCurrent = 0; dayCountCurrent = 0;
dayCountCurrentStart = dayStart.clone(); dayCountCurrentStart = dayStart.clone();
dayCountClosed++;
} }
wasOpen = false; wasOpen = false;
@ -133,6 +136,7 @@ layout: default
$( "#days_open_current td:last" ).html(dayCountCurrentText); $( "#days_open_current td:last" ).html(dayCountCurrentText);
$( "#days_open_high td:last" ).html(dayCountHighText); $( "#days_open_high td:last" ).html(dayCountHighText);
$( "#days_closed td:last" ).html(dayCountClosed + " since " + statisticSince.format(dateFormat));
$( "#space_open_percent" ).html(percentOpen + '% open'); $( "#space_open_percent" ).html(percentOpen + '% open');
$( "#space_open_percent" ).width(percentOpen + '%'); $( "#space_open_percent" ).width(percentOpen + '%');
@ -375,6 +379,14 @@ layout: default
unknown unknown
</td> </td>
</tr> </tr>
<tr id="days_closed">
<td>
days closed
</td>
<td>
unknown
</td>
</tr>
<tr> <tr>
<td> <td>
open / closed ratio open / closed ratio