From 824f10b7301d8053212b8b2f0dcf105b0c41f28c Mon Sep 17 00:00:00 2001 From: Matthew Fennell Date: Thu, 16 Apr 2026 16:26:08 +0100 Subject: Add days-after helper Currently, shuttlebot doesn't take the number of days before the booking into consideration, apart from not changing bookings on today's date. To help with fixing this, add days-after Given a base date and number of days, it will produce a consecutive list of days. Then, when searching for available bookings, we can use this list to ask "is the date I'm booking for in the list of days-after?" --- util.scm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/util.scm b/util.scm index a550427..fad9451 100644 --- a/util.scm +++ b/util.scm @@ -10,6 +10,9 @@ (append-map (lambda (x) (map (lambda (y) (cons x y)) ys)) xs)) '(()) lists)) +(define (days-after base-date min-lookahead-days) + (unfold (cut = <> min-lookahead-days) (cut date+ base-date <>) 1+ 0)) + (define* (api-request #:key method path (query #f) (request #f) (transformer identity) (token #f)) (let*-values (((record-name) -- cgit v1.2.3