aboutsummaryrefslogtreecommitdiff
path: root/module/datetime
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 /module/datetime
parentHTML Description exception handler now works. (diff)
downloadcalp-36d1aac8f08bc20e499563805a280a795f9cdfb2.tar.gz
calp-36d1aac8f08bc20e499563805a280a795f9cdfb2.tar.xz
Add some comments.
Diffstat (limited to 'module/datetime')
-rw-r--r--module/datetime/util.scm4
1 files changed, 4 insertions, 0 deletions
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))