diff --git a/ipmd/static/ipmd/js/ipmdlib.js b/ipmd/static/ipmd/js/ipmdlib.js index e17d43259cf2b1f9308b54c4d76fa9fad21c177b..ecdf682f8c895bc94e921a3bb960afa3beb2e692 100644 --- a/ipmd/static/ipmd/js/ipmdlib.js +++ b/ipmd/static/ipmd/js/ipmdlib.js @@ -255,6 +255,7 @@ async function runModel(endpoint, inputData) */ function getDateArray(timestart, interval, length) { + let dateArray = []; currentTime = moment(timestart); for(let i=0;i< length; i++) @@ -406,7 +407,9 @@ async function isPointCoveredByDatasource(coordinate, datasource) * @param {String} tableClass for styling the table, e.g. using Bootstrap */ function renderWeatherData(weatherData, container, tableClass){ - let dates = getDateArray(weatherData.timeStart, weatherData.interval, weatherData.locationWeatherData[0].length); + console.info(weatherData); + + let dates = getDateArray(weatherData.timeStart, weatherData.interval, weatherData.locationWeatherData[0].data.length); let html = "<table" + (tableClass != undefined ? " class=\"" + tableClass + "\"" : "") + "><thead><tr><th>Time</th>"; weatherData.weatherParameters.forEach(function(weatherParameterId){ html +="<th>" + getWeatherParameter(weatherParameterId).name + "</th>"; diff --git a/ipmd/templates/ipmd/saddlegallmidgeform.html b/ipmd/templates/ipmd/saddlegallmidgeform.html index 9e23a4304e0707aa762f74dd55bb03d0b9b002a3..b87e29205b4aeac718459386cfda31598d1c9704 100644 --- a/ipmd/templates/ipmd/saddlegallmidgeform.html +++ b/ipmd/templates/ipmd/saddlegallmidgeform.html @@ -478,7 +478,7 @@ } // 2. Forecast weather data - if(currentForecastWeatherDatasource != undefined) + if(currentForecastWeatherDatasource != undefined && moment(inputData.optionalData.endDate).add(1,"days").isAfter(moment())) { coordinate = getLatLon(); if(coordinate == null) @@ -518,7 +518,6 @@ } else { - // Is useless until method is implemented weatherData = mergeWeatherData(weatherData, forecastData); } }