Ei muokkausyhteenvetoa |
Ei muokkausyhteenvetoa |
||
| Rivi 57: | Rivi 57: | ||
obs = jw.obs[ o ]; | obs = jw.obs[ o ]; | ||
obsdate = obs.obsdatetime; | obsdate = obs.obsdatetime; | ||
days = ( new.getTime()-obsdate.getTime() ) / ( 1000*60*60*24 ); | |||
console.log( days ); | |||
datajson = obs.printouts.DataJSON[0]; | datajson = obs.printouts.DataJSON[0]; | ||
try { data = JSON.parse( datajson ); } catch(err) { data = false; }; | try { data = JSON.parse( datajson ); } catch(err) { data = false; }; | ||
| Rivi 109: | Rivi 111: | ||
out += '<div style="height: 40px; display: flex; justify-content: center; align-items: center; flex-direction: column;">'; | out += '<div style="height: 40px; display: flex; justify-content: center; align-items: center; flex-direction: column;">'; | ||
tooltip = 'Lukema on havainnon tuoreudella painotettu keskiarvo viimeisen 7 vuorokauden aikana järvelle tallennetuista havainnoista. Näitä havaintoja on yhteensä ' + jw.obstype[ ot ].obses.length + ' kpl, joista uusin on tehty ' + jw.obstype[ ot ].newest.toLocaleString( 'fi' ).replace( ' klo 0.00.00', '' ) + '.'; | if ( jw.obstype[ ot ].obses.length > 1 ) { | ||
tooltip = 'Lukema on havainnon tuoreudella painotettu keskiarvo viimeisen 7 vuorokauden aikana järvelle tallennetuista havainnoista. Näitä havaintoja on yhteensä ' + jw.obstype[ ot ].obses.length + ' kpl, joista uusin on tehty ' + jw.obstype[ ot ].newest.toLocaleString( 'fi' ).replace( ' klo 0.00.00', '' ) + '.'; | |||
} else { | |||
tooltip = 'Tämä on tuoreimman '; | |||
} | |||
out += '<button style="padding: 0 0.25em; font-size: 14px; margin-bottom: 3px;" type="button" class="btn btn-secondary btn-info" data-toggle="tooltip" data-placement="top" data-trigger="click" title="' + tooltip + '">'; | out += '<button style="padding: 0 0.25em; font-size: 14px; margin-bottom: 3px;" type="button" class="btn btn-secondary btn-info" data-toggle="tooltip" data-placement="top" data-trigger="click" title="' + tooltip + '">'; | ||


