Just to follow up on this a bit, I did find that Apple apparently changed semantics since the WWDC video was made, and they introduced a DonationTimeRange structure that you can use like this:
#Rule(Self.viewedDetails) {
$0.donations
.donatedWithin(.days(5))
.count > 0
Unfortunately, this doesn't provide a way to achieve what I want for one of my rules, which is to determine if the user has been using the app for at least a calendar day. You might think that you could construct an expression comparing the count of two .donatedWithin ranges:
#Rule(Self.viewedDetails) {
$0.donations.donatedWithin(.weeks(52)).count > $0.donations.donatedWithin(.days(1)).count
But no, you can't. This doesn't work because the #Rule macro explicitly requires a count comparison. If you try to write it as a raw predicate expression, it will compile but assert at runtime.
So, at this point, I've given up trying to write the rule that I wanted to write. But perhaps someone will see the question and point out something that I've missed. Or perhaps Apple will see the question and understand that .donatedWithin doesn't meet everyone's needs.