diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2022-04-23 22:13:53 +0200 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2022-04-23 22:22:20 +0200 |
commit | 460dd689177ab0083327eeaec859735e55dcf8ef (patch) | |
tree | 12b29ae603e67b736b8e3a7690633dce0a4c2fb8 /static/script.ts | |
parent | Update comment on cal-table. (diff) | |
download | calp-460dd689177ab0083327eeaec859735e55dcf8ef.tar.gz calp-460dd689177ab0083327eeaec859735e55dcf8ef.tar.xz |
Introduce component date-jump.
Diffstat (limited to '')
-rw-r--r-- | static/script.ts | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/static/script.ts b/static/script.ts index 895b0081..865c005e 100644 --- a/static/script.ts +++ b/static/script.ts @@ -137,29 +137,6 @@ window.addEventListener('load', function() { } } - - /* Replace backend-driven [today] link with frontend, with one that - gets correctly set in the frontend. Similarly, update the go to - specific date button into a link which updates wheneven the date - form updates. - */ - - let gotodatebtn = document.querySelector("#jump-to .btn")!; - let target_href = (new Date).format("~Y-~m-~d") + ".html"; - let golink = makeElement('a', { - className: 'btn', - href: target_href, - innerHTML: gotodatebtn.innerHTML, - }) as HTMLAnchorElement - gotodatebtn.replaceWith(golink); - - (document.querySelector("#jump-to input[name='date']") as HTMLInputElement) - .onchange = function() { - let date = (this as HTMLInputElement).valueAsDate!.format("~Y-~m-~d"); - console.log(date); - golink.href = date + ".html"; - } - /* ---------------------------------------- */ /* needs to be called AFTER bind_properties, but BEFORE init_input_list |