From 3e5157a907fc50715f15e9950ca9c9de8cf1f0f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Fri, 1 May 2020 16:45:13 +0200 Subject: Server now rounds to nearest sensible start. --- module/entry-points/server.scm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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)) -- cgit v1.2.3