diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2020-03-20 01:24:37 +0100 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2020-03-20 01:24:37 +0100 |
commit | a46ed559653b697896b74d3be2771d0681174b82 (patch) | |
tree | ef8b7748f9b04b67de5d4cc92b8c573b0097e6fe /module | |
parent | Introduce propper datetime->tm and vice versa. (diff) | |
download | calp-a46ed559653b697896b74d3be2771d0681174b82.tar.gz calp-a46ed559653b697896b74d3be2771d0681174b82.tar.xz |
Add datetime-{min,max}.
Diffstat (limited to 'module')
-rw-r--r-- | module/datetime/util.scm | 6 |
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))) |