Ero sivun ”Widget:Test4” versioiden välillä
Järvi-meriwikistä
Rivi 657: | Rivi 657: | ||
mwDate = new Date( memo.obsesA[o].compareDate.getFullYear(), memo.obsesA[o].compareDate.getMonth(), memo.obsesA[o].compareDate.getDate(), 12 ); | mwDate = new Date( memo.obsesA[o].compareDate.getFullYear(), memo.obsesA[o].compareDate.getMonth(), memo.obsesA[o].compareDate.getDate(), 12 ); | ||
+ | mwDate.setDate( mwDate.getDate() - mwDate.getDay() + 3 ); | ||
w = mwDate.getWeek(); | w = mwDate.getWeek(); | ||
v = memo.obsesA[o].value; | v = memo.obsesA[o].value; | ||
Rivi 666: | Rivi 667: | ||
if ( typeof memo.avgW[w] == 'undefined' ) { | if ( typeof memo.avgW[w] == 'undefined' ) { | ||
− | mwDate.setDate( mwDate.getDate() - mwDate.getDay() + 3 ) | + | mwDate.setDate( mwDate.getDate() - mwDate.getDay() + 3 ); |
memo.avgW[w] = { week: w, cDate: new Date( mwDate.getTime() ), values: [ v ], sum: v, count: 1, avg: v }; | memo.avgW[w] = { week: w, cDate: new Date( mwDate.getTime() ), values: [ v ], sum: v, count: 1, avg: v }; | ||
} else { | } else { |