State History - Fixes to search interval

After a date picker was added to the ui, changes were
needed to the backend.

The code is still messy and "number of alerts" still shows
all alerts for that logfile, but this is better than before