Fix handling calendar for nonsensical data.
This commit is contained in:
parent
bfe763c599
commit
7a0db40062
1 changed files with 20 additions and 18 deletions
|
@ -106,24 +106,26 @@
|
|||
;; contain the year in the first cell and 12 cells for months after
|
||||
;; it.
|
||||
(define (member-calendar->years-table mc)
|
||||
(let* ((fm (member-calendar-first-month mc))
|
||||
(lm (member-calendar-last-month mc))
|
||||
(fy (month-year fm))
|
||||
(ly (month-year lm)))
|
||||
(let loop ((y fy)
|
||||
(rows '()))
|
||||
(if (> y ly)
|
||||
(reverse rows)
|
||||
(loop (add1 y)
|
||||
(cons (let mloop ((m 1)
|
||||
(row (list y)))
|
||||
(if (> m 12)
|
||||
(reverse row)
|
||||
(mloop (add1 m)
|
||||
(cons (member-calendar-entry->string
|
||||
(member-calendar-query mc (make-month y m)))
|
||||
row))))
|
||||
rows))))))
|
||||
(if (null? mc)
|
||||
'()
|
||||
(let* ((fm (member-calendar-first-month mc))
|
||||
(lm (member-calendar-last-month mc))
|
||||
(fy (month-year fm))
|
||||
(ly (month-year lm)))
|
||||
(let loop ((y fy)
|
||||
(rows '()))
|
||||
(if (> y ly)
|
||||
(reverse rows)
|
||||
(loop (add1 y)
|
||||
(cons (let mloop ((m 1)
|
||||
(row (list y)))
|
||||
(if (> m 12)
|
||||
(reverse row)
|
||||
(mloop (add1 m)
|
||||
(cons (member-calendar-entry->string
|
||||
(member-calendar-query mc (make-month y m)))
|
||||
row))))
|
||||
rows)))))))
|
||||
|
||||
;; Converts the whole calendar into a list of amounts (fees)
|
||||
(define (member-calendar->fees mc)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue