diff options
author | Hugo Hörnquist <hugo@hornquist.se> | 2020-01-13 03:01:51 +0100 |
---|---|---|
committer | Hugo Hörnquist <hugo@hornquist.se> | 2020-01-13 03:01:51 +0100 |
commit | a2028c068832fcd9e2baa01fc68df6390a049d4a (patch) | |
tree | 906c5350c4eb52659de7ce6320e0a32007f322cd /module | |
parent | Use new set-> macro. (diff) | |
download | calp-a2028c068832fcd9e2baa01fc68df6390a049d4a.tar.gz calp-a2028c068832fcd9e2baa01fc68df6390a049d4a.tar.xz |
Add defaults to (date), rename attr zone to tz.
Diffstat (limited to '')
-rw-r--r-- | module/srfi/srfi-19/util.scm | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/module/srfi/srfi-19/util.scm b/module/srfi/srfi-19/util.scm index 3259e3c2..96aa6a48 100644 --- a/module/srfi/srfi-19/util.scm +++ b/module/srfi/srfi-19/util.scm @@ -169,8 +169,14 @@ attribute set to 0. Can also be seen as \"Start of day\"" (define-public (parse-freeform-date str) (string->date str "~Y-~m-~d")) -(define* (date #:key (year 0) (month 0) (day 0) (hour 0) (minute 0) (second 0) (nsecs 0) (zone 0)) - (make-date nsecs second minute hour day month year zone)) + +;; Easier constructor for date objects +;; Default values set to the begining of time. +(define* (date #:key + (year 1970) (month 1) (day 1) + (hour 0) (minute 0) (second 0) + (nsecs 0) (tz 0)) + (make-date nsecs second minute hour day month year tz)) (define-public (date=? a b) |