aboutsummaryrefslogtreecommitdiff
path: root/module/output/html.scm
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2020-05-23 11:51:56 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2020-05-23 12:59:19 +0200
commitb935e8b521270791e15e73c2f8953a68e5c5fd47 (patch)
tree2b373910589421ce195f6b168ae34abee75c2682 /module/output/html.scm
parentReplace one match-lambda* with case-lambda. (diff)
downloadcalp-b935e8b521270791e15e73c2f8953a68e5c5fd47.tar.gz
calp-b935e8b521270791e15e73c2f8953a68e5c5fd47.tar.xz
Remove special case for first day in month view.
Diffstat (limited to 'module/output/html.scm')
-rw-r--r--module/output/html.scm54
1 files changed, 21 insertions, 33 deletions
diff --git a/module/output/html.scm b/module/output/html.scm
index 0d06cbb2..045e1160 100644
--- a/module/output/html.scm
+++ b/module/output/html.scm
@@ -457,39 +457,27 @@
(div (@ (class "caltable"))
,@(map (lambda (d) `(div (@ (class "thead")) ,(string-titlecase (week-day-name d))))
(weekday-list (get-config 'week-start)))
- ,@(cons
- ;; First day is a special case, since I always want to show a full date there.
- ;; For all other days I'm only interested in the parts that change.
- (let* (((day-date . events) (stream-car event-groups)))
- `(div (@ (class "cal-cell"))
- (time (@ (class "date-info")
- (datetime ,(date->string day-date "~1")))
- (span (@ (class "day-number")) ,(date->string day-date "~e"))
- (span (@ (class "month-name")) ,(date->string day-date "~b"))
- (span (@ (class "year-number"))
- ", " ,(date->string day-date "~Y")))
- ,@(stream->list (stream-map make-small-block events))))
- (stream->list
- (stream-map
- (match-lambda
- [(day-date . events)
- `(div (@ (class "cal-cell"))
- (time (@ (class "date-info "
- ,(if (or (date< day-date start-date)
- (date< end-date day-date))
- "non-current"
- "current"))
- (datetime ,(date->string day-date "~1")))
- (span (@ (class "day-number"))
- ,(date->string day-date "~e"))
- ,(when (= 1 (day day-date))
- `(span (@ (class "month-name"))
- ,(date->string day-date "~b")))
- ,(when (= 1 (month day-date) (day day-date))
- `(span (@ (class "year-number"))
- ", " ,(date->string day-date "~Y"))))
- ,@(stream->list (stream-map make-small-block events)))])
- (stream-cdr event-groups)))))))
+ ,@(stream->list
+ (stream-map
+ (match-lambda
+ [(day-date . events)
+ `(div (@ (class "cal-cell"))
+ (time (@ (class "date-info "
+ ,(if (or (date< day-date start-date)
+ (date< end-date day-date))
+ "non-current"
+ "current"))
+ (datetime ,(date->string day-date "~1")))
+ (span (@ (class "day-number"))
+ ,(date->string day-date "~e"))
+ ,(when (= 1 (day day-date))
+ `(span (@ (class "month-name"))
+ ,(date->string day-date "~b")))
+ ,(when (= 1 (month day-date) (day day-date))
+ `(span (@ (class "year-number"))
+ ", " ,(date->string day-date "~Y"))))
+ ,@(stream->list (stream-map make-small-block events)))])
+ event-groups)))))