Create member calendar.
This commit is contained in:
parent
a729d2f991
commit
6c8d2c8dbd
5 changed files with 51 additions and 15 deletions
10
month.scm
10
month.scm
|
@ -137,9 +137,13 @@
|
|||
(error 'month-diff "Second argument is not a valid month" t))
|
||||
(error 'month-diff "First argument is not a valid month" f)))
|
||||
|
||||
;; Returns a month n months after the month m.
|
||||
(define (month-add m n)
|
||||
(let ((mi (+ (* 12 (car m)) (cadr m) n -1)))
|
||||
;; Returns a month n months after the month m. The number n defaults
|
||||
;; to 1.
|
||||
(define (month-add m . ns)
|
||||
(let* ((n (if (null? ns)
|
||||
1
|
||||
(car ns)))
|
||||
(mi (+ (* 12 (car m)) (cadr m) n -1)))
|
||||
(list (quotient mi 12)
|
||||
(+ (remainder mi 12) 1))))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue