Browse Source

fix day-of-week timestamp bug in insert-dashboard-cat filter.

I didn't realise the local-time system set 'Sunday' to '0' in its
timestamp-day-of-week function. I thought it was '7'. This commit changes the
check for '7' to '0' and adds a few comments to help identify which days the cond
form is checking against.
stable
Craig Oates 2 years ago
parent
commit
6a5b6ea838
  1. 16
      src/view.lisp

16
src/view.lisp

@ -110,12 +110,16 @@
(format nil "/images/icons/study-cat.png"))
((and (>= (local-time:timestamp-hour timestamp) 18)
(< (local-time:timestamp-hour timestamp) 20))
(cond ((<= (local-time:timestamp-day-of-week timestamp) 5)
(format nil "/images/icons/workout-cat.png"))
((= (local-time:timestamp-day-of-week timestamp) 6)
(format nil "/images/icons/rock-star-cat.png"))
((= (local-time:timestamp-day-of-week timestamp) 7)
(format nil "/images/icons/love-cat.png"))))
(cond
;; Sunday
((= (local-time:timestamp-day-of-week timestamp) 0)
(format nil "/images/icons/love-cat.png"))
;; Monday - Friday
((<= (local-time:timestamp-day-of-week timestamp) 5)
(format nil "/images/icons/workout-cat.png"))
;; Saturday
((= (local-time:timestamp-day-of-week timestamp) 6)
(format nil "/images/icons/rock-star-cat.png"))))
((and (>= (local-time:timestamp-hour timestamp) 20)
(< (local-time:timestamp-hour timestamp) 22))
(format nil "/images/icons/dinner-cat.png"))

Loading…
Cancel
Save