diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2021-12-20 22:09:57 +0100 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2021-12-20 22:09:57 +0100 |
commit | d75ebbab2a414fe1a9a09d703a3bc7be782f1f1e (patch) | |
tree | 0de4f1c17afd6fbefbafc3a0a8a91bc85cb30355 /module/datetime | |
parent | Document testrunner syntax. (diff) | |
parent | Documentation updates for util. (diff) | |
download | calp-d75ebbab2a414fe1a9a09d703a3bc7be782f1f1e.tar.gz calp-d75ebbab2a414fe1a9a09d703a3bc7be782f1f1e.tar.xz |
Merge Javascript rewrite.
Diffstat (limited to '')
-rw-r--r-- | module/datetime.scm | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/module/datetime.scm b/module/datetime.scm index c1fae3ce..50817084 100644 --- a/module/datetime.scm +++ b/module/datetime.scm @@ -73,7 +73,8 @@ (catch 'misc-error (lambda () (display (date->string r "#~Y-~m-~d") p)) (lambda (err _ fmt args . rest) - (format p "BAD~s-~s-~s" (year r) (month r) (day r)))))) + (format p "#<<date> BAD year=~s month=~s day=~s>" + (year r) (month r) (day r)))))) ;;; TIME @@ -91,8 +92,8 @@ (lambda (r p) (catch 'misc-error (lambda () (display (time->string r "#~H:~M:~S") p)) - (lambda (err _ fmt args rest) - (format p "BAD~s:~s:~s" + (lambda (err _ fmt args rest) + (format p "#<<time> hour=~s minute=~s second=~s>" (hour r) (minute r) (second r)))))) @@ -124,9 +125,14 @@ (set-record-type-printer! <datetime> (lambda (r p) - (if (and (tz r) (not (string=? "UTC" (tz r)))) - (write (datetime->sexp r) p) - (display (datetime->string r "#~1T~3~Z") p)))) + (catch 'misc-error + (lambda () + (if (and (tz r) (not (string=? "UTC" (tz r)))) + (write (datetime->sexp r) p) + (display (datetime->string r "#~1T~3~Z") p))) + (lambda (err _ fmt args . rest) + (format p "#<<datetime> BAD date=~s time=~s tz=~s>" + (get-date r) (get-time% r) (tz r)))))) |