aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2020-05-01 16:45:13 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2020-05-01 16:45:13 +0200
commit3e5157a907fc50715f15e9950ca9c9de8cf1f0f1 (patch)
treedb5793884b217526db3a93fd2cdd7470502d7082
parentMerge branch 'tooltip' (diff)
downloadcalp-3e5157a907fc50715f15e9950ca9c9de8cf1f0f1.tar.gz
calp-3e5157a907fc50715f15e9950ca9c9de8cf1f0f1.tar.xz
Server now rounds to nearest sensible start.
-rw-r--r--module/entry-points/server.scm6
1 files changed, 5 insertions, 1 deletions
diff --git a/module/entry-points/server.scm b/module/entry-points/server.scm
index 4c480fe2..270a51f4 100644
--- a/module/entry-points/server.scm
+++ b/module/entry-points/server.scm
@@ -1,6 +1,7 @@
(define-module (entry-points server)
:use-module (util)
:use-module (util app)
+ :use-module (util config)
:use-module (srfi srfi-1)
@@ -61,7 +62,9 @@
(make-routes
(GET "/week/:start-date.html" (start-date)
- (let* ((start-date (parse-iso-date start-date)))
+ (let* ((start-date
+ (start-of-week (parse-iso-date start-date)
+ (get-config 'week-start))))
(return '((content-type text/html))
(with-output-to-string
@@ -88,6 +91,7 @@
(date day: 1))
next-start: month+
prev-start: month-
+ ;; internally rounds start-date to start of month
render-calendar: render-calendar-table
pre-start: (start-of-week start-date)
post-end: (end-of-week (end-of-month start-date))