1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-19 18:20:22 +02:00

srfi-19: Fix `string->date' weekday lookup.

* srfi/srfi-19.scm (priv:locale-abbr-weekday->index): Use
  `locale-day-short' since it expects integers in the range 1-7, unlike
  `priv:locale-abbr-weekday'.
  (priv:locale-long-weekday->index): Likewise.

* test-suite/tests/srfi-19.test ("SRFI date/time
  library")["string->date works on Sunday"]: New test.
This commit is contained in:
Ludovic Courtès 2008-12-18 22:34:23 +01:00
parent 55aae98356
commit 8891556e50
2 changed files with 11 additions and 3 deletions

View file

@ -937,10 +937,10 @@
(else (loop (+ index 1))))))
(define (priv:locale-abbr-weekday->index string)
(priv:date-reverse-lookup string priv:locale-abbr-weekday 7 string=?))
(priv:date-reverse-lookup string locale-day-short 7 string=?))
(define (priv:locale-long-weekday->index string)
(priv:date-reverse-lookup string priv:locale-long-weekday 7 string=?))
(priv:date-reverse-lookup string locale-day 7 string=?))
(define (priv:locale-abbr-month->index string)
(priv:date-reverse-lookup string priv:locale-abbr-month 12 string=?))