From 36d1aac8f08bc20e499563805a280a795f9cdfb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Sun, 26 Apr 2020 01:30:03 +0200 Subject: Add some comments. --- module/datetime.scm | 1 + module/datetime/util.scm | 4 ++++ module/output/html.scm | 2 +- module/vcomponent/group.scm | 1 + 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/module/datetime.scm b/module/datetime.scm index d8a61af0..0cca216b 100644 --- a/module/datetime.scm +++ b/module/datetime.scm @@ -737,6 +737,7 @@ `(datetime date: ,(parse-date% date) time: ,(parse-time% time) tz: ,(and (string= "Z" (string-take-right str 1)) + ;; TODO shouldn't this be "UTC"? 'Z)))) (define (date-reader chr port) diff --git a/module/datetime/util.scm b/module/datetime/util.scm index a8ccda07..8c57636e 100644 --- a/module/datetime/util.scm +++ b/module/datetime/util.scm @@ -116,6 +116,9 @@ (date+ ystart (date day: (abs day-index))) (date- ystart (date day: day-index))))) +;; TODO v. 1 sometimes is calculated wrong. +;; (week-number #2020-01-01 mon) ; => 1 +;; (week-number #2019-12-31 mon) ; => 53 ; should be 1 (define*-public (week-number date optional: (wkst sun)) (let* ((week day (floor/ (days-in-interval (week-1-start date wkst) date) 7))) @@ -300,6 +303,7 @@ (* 12 (year diff))) (month-stream start-date))))))) +;; also known as Julian day. (define-public (year-day date) (days-in-interval (start-of-year date) date)) diff --git a/module/output/html.scm b/module/output/html.scm index 2600079c..1e52350a 100644 --- a/module/output/html.scm +++ b/module/output/html.scm @@ -343,7 +343,7 @@ (get-groups-between (group-stream (list->stream short-events)) start-date end-date)))))))) - + ;;; Prodcedures for text output ;; For sidebar, just text diff --git a/module/vcomponent/group.scm b/module/vcomponent/group.scm index 1309ae6d..cf0fbe82 100644 --- a/module/vcomponent/group.scm +++ b/module/vcomponent/group.scm @@ -8,6 +8,7 @@ #:export (group-stream get-groups-between)) ;; TODO templetize this +;; TODO this seems to behave weird if the first day of the week is empty (0 events). (define-stream (group-stream in-stream) (define (ein? day) (lambda (e) (event-contains? e day))) -- cgit v1.2.3