aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2020-04-26 01:30:03 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2020-04-26 01:30:03 +0200
commit36d1aac8f08bc20e499563805a280a795f9cdfb2 (patch)
treeea42d4466e61c522612c4b1cbf9e6add5e648758
parentHTML Description exception handler now works. (diff)
downloadcalp-36d1aac8f08bc20e499563805a280a795f9cdfb2.tar.gz
calp-36d1aac8f08bc20e499563805a280a795f9cdfb2.tar.xz
Add some comments.
-rw-r--r--module/datetime.scm1
-rw-r--r--module/datetime/util.scm4
-rw-r--r--module/output/html.scm2
-rw-r--r--module/vcomponent/group.scm1
4 files changed, 7 insertions, 1 deletions
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)))