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

View file

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

View file

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

View file

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