aboutsummaryrefslogtreecommitdiff
path: root/module/output
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2020-03-19 00:14:56 +0100
committerHugo Hörnquist <hugo@lysator.liu.se>2020-03-19 00:14:56 +0100
commit44c986d13c6987f65527f73eb7158a3adde4ceb0 (patch)
tree08f3db994d9da28d106b56fc4097f079f136860f /module/output
parentRemove output flag to main main. (diff)
downloadcalp-44c986d13c6987f65527f73eb7158a3adde4ceb0.tar.gz
calp-44c986d13c6987f65527f73eb7158a3adde4ceb0.tar.xz
Move date util procedures to module, document.
Diffstat (limited to 'module/output')
-rw-r--r--module/output/html.scm20
1 files changed, 1 insertions, 19 deletions
diff --git a/module/output/html.scm b/module/output/html.scm
index d59574a0..1f9af786 100644
--- a/module/output/html.scm
+++ b/module/output/html.scm
@@ -228,11 +228,6 @@
(attr ev 'DTSTART)))
events))))))
-(define* (month+ date-object #:optional (change 1))
- (date+ date-object (date month: change)))
-
-(define* (month- date-object #:optional (change 1))
- (date- date-object (date month: change)))
;; Given a list, partitions it up into sublists of width length,
;;; each starting with 'tr.
@@ -242,15 +237,6 @@
(cons `(tr ,@row)
(tablify rest width)))))
-(define (month-days date week-start)
- (let* ((month (month date))
- (month-len (days-in-month date))
- (prev-month-len (days-in-month (month- date)))
- (month-start (modulo (- (week-day date) week-start) 7)))
- (values
- (iota month-start (1+ (- prev-month-len month-start)))
- (iota month-len 1)
- (iota (modulo (- (* 7 5) month-len month-start) 7) 1))))
;; date should be start of month
;; @example
@@ -273,12 +259,8 @@
,text)))
`(table (@ (class "small-calendar"))
- ;; NOTE Sunday first since my code assumes that is the first day of the week.
(thead (tr ,@(map (lambda (d) `(td ,(week-day-name d 2)))
- ;; '(SÖ MÅ TI ON TO FR LÖ)
- (take (drop (apply circular-list (iota 7))
- week-start)
- 7))))
+ (weekday-list week-start))))
((tbody ,@(let* ((last current next
(month-days date week-start)))