diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2021-02-01 13:20:11 +0100 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2021-02-01 13:20:11 +0100 |
commit | d1611a85e967596b78292d140d6aec4bc6d89d07 (patch) | |
tree | de10f1ae4087039985ef04bd1549a77f5f27b014 /static/clock.js | |
parent | Add only-future checkbox on search page. (diff) | |
download | calp-d1611a85e967596b78292d140d6aec4bc6d89d07.tar.gz calp-d1611a85e967596b78292d140d6aec4bc6d89d07.tar.xz |
Fix small-cal highlight for "remote" dates.
Diffstat (limited to '')
-rw-r--r-- | static/clock.js | 6 |
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"; + } } } |