aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2021-02-01 13:20:11 +0100
committerHugo Hörnquist <hugo@lysator.liu.se>2021-02-01 13:20:11 +0100
commitd1611a85e967596b78292d140d6aec4bc6d89d07 (patch)
treede10f1ae4087039985ef04bd1549a77f5f27b014
parentAdd only-future checkbox on search page. (diff)
downloadcalp-d1611a85e967596b78292d140d6aec4bc6d89d07.tar.gz
calp-d1611a85e967596b78292d140d6aec4bc6d89d07.tar.xz
Fix small-cal highlight for "remote" dates.
-rw-r--r--static/clock.js6
1 files changed, 5 insertions, 1 deletions
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";
+ }
}
}