A fairly common pattern that I've seen over and over in multiple domains is this:
Given a group of of "things" with a start and stop date, list all the things that are "active" during a given date range.
Some one abstracted it because we have several "things" that use this logic.Then it had a bug because some of the things are inclusive and some are exclusive.
Then it had a bug because some of the things use dates and some timestamps.
Then it had a bug because some of the things are timezone aware and some are not.
So we started down the path of a rather simple query construction becoming a complex thing with flags for inclusive/exclusive for start and end, timezone settings ...