CRM-13455 improve getEvents query to account for empty end_date