added endDate parameter to daysSinceLastVisit definition