Ero sivun ”Widget:JwCurrentCharts” versioiden välillä
Järvi-meriwikistä
Rivi 813: | Rivi 813: | ||
for ( var o in memo.obsesA ) { | for ( var o in memo.obsesA ) { | ||
aw = ( 7 - Math.round( ( today.getTime() - memo.obsesA[o].obsdatetime.getTime() ) / ( 24*60*60*1000 ) ) ); | aw = ( 7 - Math.round( ( today.getTime() - memo.obsesA[o].obsdatetime.getTime() ) / ( 24*60*60*1000 ) ) ); | ||
− | asum += memo.obsesA[o].data.val * aw; | + | asum += memo.obsesA[o].data.val * aw; |
− | |||
acsum = acsum + aw; | acsum = acsum + aw; | ||
ac++; | ac++; | ||
} | } | ||
− | if ( | + | if ( acsum > 0 ) { |
− | |||
− | |||
− | |||
var aavg = asum/acsum; | var aavg = asum/acsum; |