Porting to new calendar modules.

This commit is contained in:
Dominik Pantůček 2023-05-09 22:56:50 +02:00
parent 21a58e9536
commit cc463991c1
10 changed files with 57 additions and 545 deletions

View file

@ -73,8 +73,8 @@
primes
brmember
ansi
period
month
cal-period
cal-month
configuration
progress
mbase-dir
@ -224,7 +224,7 @@
di7))
(define (members-base-oldest-month mb)
(make-month 2015 1))
(make-cal-month 2015 1))
;; Returns a list two lists: keys, data.
;; Each data record contains values for all keys.
@ -232,14 +232,14 @@
(let ((keys '(month total active suspended students destroyed invalid)))
(let mloop ((data '())
(month (members-base-oldest-month mb)))
(if (month<? month (*current-month*))
(if (cal-month<? month (*current-month*))
(let ((bi (parameterize ((*current-month* month))
(mbase-info mb))))
(let kloop ((row (list (ldict-ref bi 'month)))
(keys (cdr keys)))
(if (null? keys)
(mloop (cons (reverse row) data)
(month-add month 1))
(cal-month-add month 1))
(kloop (cons (length (ldict-ref bi (car keys))) row)
(cdr keys)))))
(list keys (reverse data))))))