Fixed search/sort for the dates

Also fixed issue #119