streak(dates, today) where dates is a set of login dates. Count the current streak ending at today: if today is present, count backwards day by day while dates are present. If today is absent the streak is 0.streak({date(2026,7,26), date(2026,7,27), date(2026,7,28)}, date(2026,7,28))3
Three consecutive days ending today.
while current in dates: count and step back one day.
Start current at today.