aboutsummaryrefslogtreecommitdiff
path: root/module/vcomponent/datetime.scm
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2020-08-04 13:35:52 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2020-08-04 13:35:52 +0200
commit89a657ed98e70efaeef566b0876b406bbcdb2255 (patch)
tree1baf2693f2eacdbc3a797746252a41c47f3b38e3 /module/vcomponent/datetime.scm
parentAdd more to make install. (diff)
downloadcalp-89a657ed98e70efaeef566b0876b406bbcdb2255.tar.gz
calp-89a657ed98e70efaeef566b0876b406bbcdb2255.tar.xz
Start work on long event layout for months.
Diffstat (limited to 'module/vcomponent/datetime.scm')
-rw-r--r--module/vcomponent/datetime.scm11
1 files changed, 10 insertions, 1 deletions
diff --git a/module/vcomponent/datetime.scm b/module/vcomponent/datetime.scm
index 3f81c359..faeae70a 100644
--- a/module/vcomponent/datetime.scm
+++ b/module/vcomponent/datetime.scm
@@ -122,6 +122,15 @@ Event must have the DTSTART and DTEND protperty set."
(datetime-difference it (prop ev 'DTSTART)))
#f)))
+(define-public (really-long-event? ev)
+ (let ((start (prop ev 'DTSTART))
+ (end (prop ev 'DTEND)))
+ (if (date? start)
+ (and end (date< (date+ start (date day: 1)) end))
+ (and end
+ (datetime< (datetime date: (date day: 1))
+ (datetime-difference end start))))))
+
;; DTEND of the last instance of this event.
;; event → (or datetime #f)
@@ -136,7 +145,7 @@ Event must have the DTSTART and DTEND protperty set."
(as-datetime final))
#f))))
-;; date, date, [sorted-stream events] → [list events]
+;; date, date, [sorted-stream events] → [sorted-stream events]
(define-public (events-between start-date end-date events)
(define (overlaps e)
(timespan-overlaps? start-date (date+ end-date (date day: 1))