aboutsummaryrefslogtreecommitdiff
path: root/module/datetime
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2020-03-20 01:24:37 +0100
committerHugo Hörnquist <hugo@lysator.liu.se>2020-03-20 01:24:37 +0100
commita46ed559653b697896b74d3be2771d0681174b82 (patch)
treeef8b7748f9b04b67de5d4cc92b8c573b0097e6fe /module/datetime
parentIntroduce propper datetime->tm and vice versa. (diff)
downloadcalp-a46ed559653b697896b74d3be2771d0681174b82.tar.gz
calp-a46ed559653b697896b74d3be2771d0681174b82.tar.xz
Add datetime-{min,max}.
Diffstat (limited to 'module/datetime')
-rw-r--r--module/datetime/util.scm6
1 files changed, 6 insertions, 0 deletions
diff --git a/module/datetime/util.scm b/module/datetime/util.scm
index 268166d1..50c7c725 100644
--- a/module/datetime/util.scm
+++ b/module/datetime/util.scm
@@ -33,6 +33,12 @@
(define-public (time-max a b)
(if (time<? a b) b a))
+(define-public (datetime-min a b)
+ (if (datetime< a b) a b))
+
+(define-public (datetime-max a b)
+ (if (datetime< a b) b a))
+
(define*-public (month+ date-object #:optional (change 1))
(date+ date-object (date month: change)))