diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2020-03-25 00:06:31 +0100 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2020-03-25 00:06:31 +0100 |
commit | 8bb7f65d9e75d0e1daf94b1257f80559c9134fd2 (patch) | |
tree | e653cc561e511bf5c492bb352b784c3be352f6c3 /module/datetime | |
parent | Update TODO. (diff) | |
download | calp-8bb7f65d9e75d0e1daf94b1257f80559c9134fd2.tar.gz calp-8bb7f65d9e75d0e1daf94b1257f80559c9134fd2.tar.xz |
minor cleanup.
Diffstat (limited to '')
-rw-r--r-- | module/datetime.scm | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/module/datetime.scm b/module/datetime.scm index ac826601..f7455501 100644 --- a/module/datetime.scm +++ b/module/datetime.scm @@ -173,19 +173,19 @@ (cond [(datetime? date/-time) (get-date date/-time)] [(date? date/-time) date/-time] [(time? date/-time) (date)] - [else "Object not a date, time, or datetime object ~a" date/-time])) + [else (error "Object not a date, time, or datetime object ~a" date/-time)])) (define-public (as-time date/-time) (cond [(datetime? date/-time) (get-time% (get-datetime date/-time))] [(date? date/-time) (time)] [(time? date/-time) date/-time] - [else "Object not a date, time, or datetime object ~a" date/-time])) + [else (error "Object not a date, time, or datetime object ~a" date/-time)])) (define-public (as-datetime dt) (cond [(datetime? dt) dt] [(date? dt) (datetime date: dt time: (time))] [(time? dt) (datetime time: dt date: (date))] - [else "Object not a date, time, or datetime object ~a" dt])) + [else (error "Object not a date, time, or datetime object ~a" dt)])) ;;; EQUIALENCE @@ -621,6 +621,7 @@ (set (year b**) = (- (year a**)))) + (define-public (date-difference b a) (when (or (negative? (month b)) (negative? (day b)) |