diff --git a/lib/radio-news.html b/lib/radio-news.html index 2d98aa1..8ede5b6 100644 --- a/lib/radio-news.html +++ b/lib/radio-news.html @@ -103,15 +103,28 @@ request.open("POST", newsEndpoint, false); // synchronous request.send( JSON.stringify({ - from: isoString(new Date(formData.get("from"))), - to: isoString(new Date(formData.get("to"))), + from: formData.get("from") + ":00Z", + to: formData.get("to") + ":00Z", text: formData.get("text"), }) ); location.reload(); } + function setDate() { + let now = new Date(); + document.getElementById("time-from").value = now + .toISOString() + .slice(0, 16); + + now.setHours(now.getHours() + 1); + document.getElementById("time-to").value = now + .toISOString() + .slice(0, 16); + } + window.onload = () => { + setDate(); setNextNews(); fetchNews(); }; @@ -122,10 +135,10 @@

Submit news

- - - - + + + +