mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-10 14:00:21 +02:00
(date-week-number): Correction, day of week starting
week applied was off by one.
This commit is contained in:
parent
b1c602176c
commit
f3cc3dabe6
1 changed files with 5 additions and 0 deletions
|
@ -821,8 +821,13 @@
|
|||
(modulo (- day-of-week-starting-week fdweek-day)
|
||||
7)))
|
||||
|
||||
;; The "-1" here is a fix for the reference implementation, to make a new
|
||||
;; week start on the given day-of-week-starting-week. date-year-day returns
|
||||
;; a day starting from 1 for 1st Jan.
|
||||
;;
|
||||
(define (date-week-number date day-of-week-starting-week)
|
||||
(quotient (- (date-year-day date)
|
||||
1
|
||||
(priv:days-before-first-week date day-of-week-starting-week))
|
||||
7))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue