aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2020-04-05 23:04:41 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2020-04-05 23:04:41 +0200
commit3a77e5fd21e6bc0f9062fbfd734d5dcc5fda8f1e (patch)
treea697a5ca332efa1b98e89369c1db81a5aadcd3b9
parentMinor changes. (diff)
downloadcalp-3a77e5fd21e6bc0f9062fbfd734d5dcc5fda8f1e.tar.gz
calp-3a77e5fd21e6bc0f9062fbfd734d5dcc5fda8f1e.tar.xz
Fix JS for current time.
-rw-r--r--module/output/html.scm5
-rw-r--r--static/script.js10
2 files changed, 3 insertions, 12 deletions
diff --git a/module/output/html.scm b/module/output/html.scm
index 80a5798b..64621e54 100644
--- a/module/output/html.scm
+++ b/module/output/html.scm
@@ -222,7 +222,7 @@
(fix-event-widths! short-events event-length-key: (lambda (e) (event-length/day day-date e)))
- `(div (@ (class "events"))
+ `(div (@ (class "events") (id ,(date-link day-date)))
,@(map (lambda (time)
`(div (@ (class "clock clock-" ,time)) ""))
(iota 12 0 2))
@@ -286,8 +286,7 @@
,@(lay-out-long-events start-date end-date long-events))
,@(map (lambda (day-date)
`(div (@ (class "meta"))
- ,(let ((str (date-link day-date)))
- `(span (@ (id ,str) (class "daydate")) ,str))
+ (span (@ (class "daydate")) ,(date->string day-date "~Y-~m-~d"))
(span (@ (class "dayname")) ,(string-titlecase (date->string day-date "~a")))) )
range)
,@(stream->list
diff --git a/static/script.js b/static/script.js
index dcc7285f..7f7a235b 100644
--- a/static/script.js
+++ b/static/script.js
@@ -76,12 +76,7 @@ var bar_object = false
function update_current_time_bar () {
var now = new Date()
- var today = document
- .getElementById(time_to_date(now))
- .parentElement
- .parentElement
-
- var event_area = today.getElementsByClassName("events")[0]
+ var event_area = document.getElementById(time_to_date(now))
if (bar_object) {
bar_object.parentNode.removeChild(bar_object)
@@ -101,9 +96,7 @@ function toggle_event_pupup () {
}
window.onload = function () {
- console.log("Running");
- /*
update_current_time_bar()
// once a minute for now, could probably be slowed to every 10 minutes
window.setInterval(update_current_time_bar, 1000 * 60)
@@ -113,7 +106,6 @@ window.onload = function () {
c.onmouseup = onmouseuphandler;
c.onmousemove = onmousemovehandler;
}
- */
for (let e of document.getElementsByClassName("event-inner")) {
e.onclick = toggle_event_pupup;