summaryrefslogtreecommitdiff
path: root/srfi/srfi-19.scm
diff options
context:
space:
mode:
authorNeil Jerram <neil@ossau.uklinux.net>2002-02-23 22:24:24 +0000
committerNeil Jerram <neil@ossau.uklinux.net>2002-02-23 22:24:24 +0000
commit359b471e2671d04096bd9605dc23fc89aa00374a (patch)
tree309304ac4db94bf61d92c3b30f701b2658ce951b /srfi/srfi-19.scm
parentb55542ee46bb82e3cce186663d668d8e7925da85 (diff)
downloadguile-359b471e2671d04096bd9605dc23fc89aa00374a.tar.gz
* Fix date-week-number bug in srfi-19.scm.
Diffstat (limited to 'srfi/srfi-19.scm')
-rw-r--r--srfi/srfi-19.scm8
1 files changed, 5 insertions, 3 deletions
diff --git a/srfi/srfi-19.scm b/srfi/srfi-19.scm
index f1ad0e7cc..5f21847b4 100644
--- a/srfi/srfi-19.scm
+++ b/srfi/srfi-19.scm
@@ -797,9 +797,11 @@
(define (leap-year? date)
(priv:leap-year? (date-year date)))
-(define priv:month-assoc '((1 . 31) (2 . 59) (3 . 90) (4 . 120)
- (5 . 151) (6 . 181) (7 . 212) (8 . 243)
- (9 . 273) (10 . 304) (11 . 334) (12 . 365)))
+;; Map 1-based month number M to number of days in the year before the
+;; start of month M (in a non-leap year).
+(define priv:month-assoc '((1 . 0) (2 . 31) (3 . 59) (4 . 90)
+ (5 . 120) (6 . 151) (7 . 181) (8 . 212)
+ (9 . 243) (10 . 273) (11 . 304) (12 . 334)))
(define (priv:year-day day month year)
(let ((days-pr (assoc month priv:month-assoc)))