Fixed APRS weather rain reports.

This commit is contained in:
Marat Fayzullin 2024-02-24 16:46:59 -05:00
parent be7b90392f
commit eee4a99b7d
1 changed files with 8 additions and 5 deletions

View File

@ -502,12 +502,15 @@ AprsMarker.prototype.getInfoHTML = function(name, receiverMarker = null) {
}
}
if (this.weather.rain && (this.weather.rain.day>0)) {
weatherString += Utils.makeListItem('Rain',
this.weather.rain.hour.toFixed(0) + ' mm/h, ' +
this.weather.rain.day.toFixed(0) + ' mm/day'
if (this.weather.rain) {
var rain = this.weather.rain.hour>0? this.weather.rain.hour.toFixed(0) + ' mm/h' : '';
if (this.weather.rain.day>0) {
rain += (rain!=''? ', ' : '') + this.weather.rain.day.toFixed(0) + ' mm/day';
}
// this.weather.rain.sincemidnight + ' mm since midnight'
);
if (rain!='') {
weatherString += Utils.makeListItem('Rain', rain);
}
}
if (this.weather.snowfall) {