From a2028c068832fcd9e2baa01fc68df6390a049d4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Mon, 13 Jan 2020 03:01:51 +0100 Subject: Add defaults to (date), rename attr zone to tz. --- module/srfi/srfi-19/util.scm | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'module/srfi') 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) -- cgit v1.2.3