Fixed the search by date functionality