Improved relative time selection in GenericAgent and TicketSearch.
This fixes bug#8200.
Refactored TicketSearch time handling code.