aboutsummaryrefslogtreecommitdiff
path: root/module/datetime.scm
diff options
context:
space:
mode:
Diffstat (limited to 'module/datetime.scm')
-rw-r--r--module/datetime.scm36
1 files changed, 23 insertions, 13 deletions
diff --git a/module/datetime.scm b/module/datetime.scm
index b8b515fc..3bbb48a9 100644
--- a/module/datetime.scm
+++ b/module/datetime.scm
@@ -208,19 +208,29 @@
;; 2020-02-00 + 0-0- (40 - 31) ;
;; 2020-02-09
-(define-public (date= a b)
- (and (= (year a) (year b))
- (= (month a) (month b))
- (= (day a) (day b))))
-
-(define-public (time= a b)
- (and (= (hour a) (hour b))
- (= (minute a) (minute b))
- (= (second a) (second b))))
-
-(define-public (datetime= a b)
- (and (date= (get-date a) (get-date b))
- (time= (get-time% a) (get-time% b))))
+(define-public (date= . args)
+ (reduce (lambda (a b)
+ (and (= (year a) (year b))
+ (= (month a) (month b))
+ (= (day a) (day b))
+ ;; return object
+ a))
+ #t args))
+
+(define-public (time= . args)
+ (reduce (lambda (a b)
+ (and (= (hour a) (hour b))
+ (= (minute a) (minute b))
+ (= (second a) (second b))
+ a))
+ #t args))
+
+(define-public (datetime= . args)
+ (reduce (lambda (a b)
+ (and (date= (get-date a) (get-date b))
+ (time= (get-time% a) (get-time% b))
+ a))
+ #t args))
(define-many define-public
(date=?) date=