modifed datetimepicker so that startDate and endDate parameters accept either a string or a Date