Use new current month/day forms.

This commit is contained in:
Dominik Pantůček 2023-06-22 21:51:08 +02:00
parent 03520fc63b
commit fc0d87cbdd
4 changed files with 51 additions and 45 deletions

View file

@ -451,14 +451,16 @@
(make-ldict (make-ldict
'((highlights . ((123 "Interesting..." 0 info))))))) '((highlights . ((123 "Interesting..." 0 info)))))))
(test-true brmember-destroyed? (test-true brmember-destroyed?
(parameterize ((*current-month* (make-cal-month 2023 2))) (with-current-month
(make-cal-month 2023 2)
(brmember-destroyed? (brmember-destroyed?
(make-ldict `((info . ,(make-ldict (make-ldict `((info . ,(make-ldict
`((member . (,(make-cal-period `((member . (,(make-cal-period
(make-cal-month 2010 1) (make-cal-month 2010 1)
(make-cal-month 2010 5)))))))))))) (make-cal-month 2010 5))))))))))))
(test-false brmember-destroyed? (test-false brmember-destroyed?
(parameterize ((*current-month* (make-cal-month 2009 2))) (with-current-month
(make-cal-month 2009 2)
(brmember-destroyed? (brmember-destroyed?
(make-ldict `((info . ,(make-ldict (make-ldict `((info . ,(make-ldict
`((member . (,(make-cal-period `((member . (,(make-cal-period
@ -471,7 +473,8 @@
(make-cal-month 2015 1) (make-cal-month 2015 1)
#f)))))))))) #f))))))))))
(test-true brmember-suspended? (test-true brmember-suspended?
(parameterize ((*current-month* (make-cal-month 2015 2))) (with-current-month
(make-cal-month 2015 2)
(brmember-suspended? (brmember-suspended?
(make-ldict `((info . ,(make-ldict (make-ldict `((info . ,(make-ldict
`((member . (,(make-cal-period `((member . (,(make-cal-period
@ -481,7 +484,8 @@
(make-cal-month 2010 1) (make-cal-month 2010 1)
(make-cal-month 2022 4) #f #f)))))))))) (make-cal-month 2022 4) #f #f))))))))))
(test-true brmember-suspended? (test-true brmember-suspended?
(parameterize ((*current-month* (make-cal-month 2015 2))) (with-current-month
(make-cal-month 2015 2)
(brmember-suspended? (brmember-suspended?
(make-ldict `((info . ,(make-ldict (make-ldict `((info . ,(make-ldict
`((member . (,(make-cal-period `((member . (,(make-cal-period
@ -491,7 +495,8 @@
(make-cal-month 2010 1) (make-cal-month 2010 1)
#f #f #f)))))))))) #f #f #f))))))))))
(test-false brmember-suspended? (test-false brmember-suspended?
(parameterize ((*current-month* (make-cal-month 2023 2))) (with-current-month
(make-cal-month 2023 2)
(brmember-suspended? (brmember-suspended?
(make-ldict `((info . ,(make-ldict (make-ldict `((info . ,(make-ldict
`((member . (,(make-cal-period `((member . (,(make-cal-period
@ -501,7 +506,8 @@
(make-cal-month 2022 4) (make-cal-month 2022 4)
#f #f)))))))))) #f #f))))))))))
(test-true brmember-active? (test-true brmember-active?
(parameterize ((*current-month* (make-cal-month 2023 2))) (with-current-month
(make-cal-month 2023 2)
(brmember-active? (brmember-active?
(make-ldict `((info . ,(make-ldict (make-ldict `((info . ,(make-ldict
`((member . (,(make-cal-period `((member . (,(make-cal-period

View file

@ -236,7 +236,7 @@
(let mloop ((data '()) (let mloop ((data '())
(month (members-base-oldest-month mb))) (month (members-base-oldest-month mb)))
(if (cal-month<? month (*current-month*)) (if (cal-month<? month (*current-month*))
(let ((bi (parameterize ((*current-month* month)) (let ((bi (with-current-month month
(mbase-info mb)))) (mbase-info mb))))
(let kloop ((row (list (ldict-ref bi 'month))) (let kloop ((row (list (ldict-ref bi 'month)))
(keys (cdr keys))) (keys (cdr keys)))

View file

@ -83,8 +83,8 @@
(reverse cal) (reverse cal)
(loop (cal-month-add cm) (loop (cal-month-add cm)
(cons (list cm (cons (list cm
(parameterize ((*current-month* cm) (with-current-month
(*current-day* (cal-ensure-day cm))) cm
(brmember-flags mr))) (brmember-flags mr)))
cal)))))) cal))))))

View file

@ -268,7 +268,7 @@
(bank-transaction-message bt) (bank-transaction-message bt)
(if (eq? curr 'CZK) (if (eq? curr 'CZK)
amt amt
(parameterize ((*current-month* (cal-ensure-month day))) (with-current-day day
(* amt (lookup-eur-rate)))) (* amt (lookup-eur-rate))))
"Payment"))) "Payment")))
bts)) bts))