From 45b2adc1fd8d0555b23a41fcbfde273f7a979067 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Wed, 13 Jan 2021 22:48:42 +0100 Subject: Repair timebar. --- static/clock.js | 6 +++--- static/script.js | 7 ++++--- 2 files changed, 7 insertions(+), 6 deletions(-) (limited to 'static') diff --git a/static/clock.js b/static/clock.js index 40382faa..b7777a08 100644 --- a/static/clock.js +++ b/static/clock.js @@ -16,14 +16,14 @@ class Timebar extends Clock { update(now) { - if (! (this.start_time <= now.getTime() && now.getTime() < this.end_time)) - return; + // if (! (this.start_time <= now.getTime() && now.getTime() < this.end_time)) + // return; var event_area = document.getElementById(now.format("~Y-~m-~d")) if (event_area) { if (this.bar_object) { - this.bar_object.parentNode.removeChild(bar_object) + this.bar_object.parentNode.removeChild(this.bar_object) } else { this.bar_object = makeElement ('div', { id: 'bar', diff --git a/static/script.js b/static/script.js index 3a3148b5..312da431 100644 --- a/static/script.js +++ b/static/script.js @@ -228,8 +228,8 @@ function place_in_edit_mode (event) { } window.onload = function () { - let start_time = document.querySelector("meta[name='start-time']").content; - let end_time = document.querySelector("meta[name='end-time']").content; + // let start_time = document.querySelector("meta[name='start-time']").content; + // let end_time = document.querySelector("meta[name='end-time']").content; const button_updater = new ButtonUpdater( document.getElementById("today-button"), @@ -239,9 +239,10 @@ window.onload = function () { const sch = new SmallcalCellHighlight( document.querySelector('.small-calendar')) - const timebar = new Timebar(start_time, end_time); + const timebar = new Timebar(/*start_time, end_time*/); timebar.update(new Date); + sch.update(new Date); window.setInterval(() => { let d = new Date; timebar.update(d); -- cgit v1.2.3