From d1611a85e967596b78292d140d6aec4bc6d89d07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Mon, 1 Feb 2021 13:20:11 +0100 Subject: Fix small-cal highlight for "remote" dates. --- static/clock.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'static/clock.js') diff --git a/static/clock.js b/static/clock.js index b7777a08..9642ebaf 100644 --- a/static/clock.js +++ b/static/clock.js @@ -49,10 +49,14 @@ class SmallcalCellHighlight extends Clock { this.current_cell.style.border = ""; } + /* This is expeced to fail if the current date is not + currently on screen. */ this.current_cell = this.small_cal.querySelector( "time[datetime='" + now.format("~Y-~m-~d") + "']"); - this.current_cell.style.border = "1px solid black"; + if (this.current_cell) { + this.current_cell.style.border = "1px solid black"; + } } } -- cgit v1.2.3