I need to compare an attribute of Date data type with current date and check if it has a difference of 7 days or more.
I tried this but its not working:
if (Calendar.current.dateComponents([.day], from: resident.infectionDate ?? Date.distantPast, to: Date.now) < 7)
Error: Referencing operator function '<' on 'BinaryInteger' requires that 'DateComponents' conform to 'BinaryInteger'