Ero sivun ”Widget:XJwCharts” versioiden välillä
Järvi-meriwikistä
Rivi 29: | Rivi 29: | ||
var data = {}; | var data = {}; | ||
− | var firstW = 3000; lastW = 0; | + | var firstW = 3000; lastW = 0; |
+ | var cnewyear = new Date( now.getFullYear()+1, 0, 1 ); | ||
for ( var o in jw.obsList ) { | for ( var o in jw.obsList ) { | ||
Rivi 44: | Rivi 45: | ||
} | } | ||
− | var days = ( obs.comparedate.getTime() - | + | var days = ( obs.comparedate.getTime() - cnewyear.getTime() ) / ( 1000*60*60*24 ); |
firstW = Math.min( firstW, obs.winter ); lastW = Math.min( lastW, obs.winter ); | firstW = Math.min( firstW, obs.winter ); lastW = Math.min( lastW, obs.winter ); |