From b935e8b521270791e15e73c2f8953a68e5c5fd47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Sat, 23 May 2020 11:51:56 +0200 Subject: Remove special case for first day in month view. --- module/output/html.scm | 54 ++++++++++++++++++++------------------------------ 1 file changed, 21 insertions(+), 33 deletions(-) (limited to 'module/output') 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))))) -- cgit v1.2.3