aboutsummaryrefslogtreecommitdiff
path: root/module
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2020-03-19 02:22:15 +0100
committerHugo Hörnquist <hugo@lysator.liu.se>2020-03-19 02:22:15 +0100
commit9f37b6b15eef6f314720c600a823b275d5f3c889 (patch)
tree1795f543649418b524bbb1978f82580123020fdd /module
parentFix year-rollover bug in month-days. (diff)
downloadcalp-9f37b6b15eef6f314720c600a823b275d5f3c889.tar.gz
calp-9f37b6b15eef6f314720c600a823b275d5f3c889.tar.xz
Update html output to use new month-days.
Diffstat (limited to 'module')
-rw-r--r--module/output/html.scm23
1 files changed, 7 insertions, 16 deletions
diff --git a/module/output/html.scm b/module/output/html.scm
index 1f9af786..fbc4728a 100644
--- a/module/output/html.scm
+++ b/module/output/html.scm
@@ -251,12 +251,12 @@
;; today - used to highlight current date
;; week-start - which day the week begins on, see (datetime util)
(define (cal-table date today week-start)
- (define ((td attr other-date) text)
+ (define ((td attr) date)
`(td (@ ,attr)
- (a (@ (href ,(date->string other-date "~Y-~m-~d")
- ".html#" ,(date->string (set (day other-date) text) "~Y-~m-~d"))
+ (a (@ (href ,(date->string (set (day date) 1) "~Y-~m-~d")
+ ".html#" ,(date->string date "~Y-~m-~d"))
(class "hidelink"))
- ,text)))
+ ,(day date))))
`(table (@ (class "small-calendar"))
(thead (tr ,@(map (lambda (d) `(td ,(week-day-name d 2)))
@@ -267,20 +267,11 @@
(define lst
(append
;; ... 28 29 |
- (map (td '(class "prev") (month- date))
- last)
+ (map (td '(class "prev")) last)
;; 1 2 ... 30 31
- (map (lambda (p) `(td (@ ,@(assq-merge '((class " cur ")) (cdar p)))
- ,@(cdr p)))
- (map (lambda (d) `((@ (class ,(when (date=? today (set (day date) d))
- "today")))
- (a (@ (href "#" ,(date->string (set (day date) d)
- "~Y-~m-~d"))
- (class "hidelink")) ,d)))
- current))
+ (map (td '(class "cur")) current)
;; | 1 2 ...
- (map (td '(class "next") (month+ date))
- next)))
+ (map (td '(class "next")) next)))
(tablify lst 7))))))