Compare commits

..

No commits in common. "ac5fea2c644601c3ad49aa938eaad2b0aec57410" and "132524b1c74f34cda16122b8f43d885a846c4589" have entirely different histories.

View File

@ -98,9 +98,7 @@
const valTime = await fetch('https://opendata-download-metfcst.smhi.se/api/category/pmp3g/version/2/validtime.json'); const valTime = await fetch('https://opendata-download-metfcst.smhi.se/api/category/pmp3g/version/2/validtime.json');
const times = await valTime.json(); const times = await valTime.json();
var time = times.validTime[1].replace(/-/g, "").replace(/:/g, ""); var time = times.validTime[1].replace(/-/g, "").replace(/:/g, "");
var textTime = new Date(times.validTime[1]).toLocaleString("en-GB", {dateStyle: "short", timeStyle: "short"}); document.getElementById('clouds').textContent = "Cloud Coverage Forcast for " + times.validTime[1].replace(/T/g, " ").replace(/Z/g, " UTC");
var textTimeUTC = new Date(times.validTime[1]).toLocaleTimeString("en-GB", {timeZone: "UTC", timeStyle: "short"});
document.getElementById('clouds').textContent = "Cloud Coverage Forecast for " + textTime + " (" + textTimeUTC+" UTC)";
const res = await fetch(`https://opendata-download-metfcst.smhi.se/api/category/pmp3g/version/2/geotype/multipoint/validtime/${time}/parameter/tcc_mean/leveltype/hl/level/0/data.json`); const res = await fetch(`https://opendata-download-metfcst.smhi.se/api/category/pmp3g/version/2/geotype/multipoint/validtime/${time}/parameter/tcc_mean/leveltype/hl/level/0/data.json`);
const data = await res.json(); const data = await res.json();