Slightly more sophisticated handling of date search to support periods