New way to find date range for next and previous occurrences as it was giving wrong values for some events.