make getDateArrayForSearch, runSearch function