diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2020-07-15 00:47:27 +0200 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2020-07-15 00:47:27 +0200 |
commit | a925dd38ad8a51dbf443506b0772150a5cef0799 (patch) | |
tree | e7c3250e0aff34c5cab90b454b8d95765fc6c795 /static/script.js | |
parent | HTML Generated events now come without an UID. (diff) | |
download | calp-a925dd38ad8a51dbf443506b0772150a5cef0799.tar.gz calp-a925dd38ad8a51dbf443506b0772150a5cef0799.tar.xz |
Repair jump to date.
Diffstat (limited to 'static/script.js')
-rw-r--r-- | static/script.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/static/script.js b/static/script.js index 6870819b..822b60c2 100644 --- a/static/script.js +++ b/static/script.js @@ -493,8 +493,7 @@ window.onload = function () { form updates. */ - let jumpto = document.getElementsByClassName("jump-to")[0]; - let gotodatebtn = jumpto.getElementsByTagName("button")[0]; + let gotodatebtn = document.querySelector("#jump-to .btn"); let target_href = (new Date).format("%Y-%m-%d") + ".html"; let golink = makeElement('a', { className: 'btn', @@ -504,8 +503,9 @@ window.onload = function () { document.getElementById("today-button").href = target_href; gotodatebtn.replaceWith(golink); - jumpto.getElementsByTagName("input")[0].onchange = function () { + document.querySelector("#jump-to input[name='date']").onchange = function () { let date = this.valueAsDate.format("%Y-%m-%d"); + console.log(date); golink.href = date + ".html"; } |