From 9f37b6b15eef6f314720c600a823b275d5f3c889 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Thu, 19 Mar 2020 02:22:15 +0100 Subject: Update html output to use new month-days. --- module/output/html.scm | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) (limited to 'module') 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)))))) -- cgit v1.2.3