I have a situation with a recurring billing application where I need
to test if one range of dates “overlaps” another range of dates. Does
anyone know a rails find or mysql select statement that will test for
this? Here are the details:
- Recurringcharge items have a start_date and an end_date that
represent the period of time that the charges should occur.
- Statement items have begin_on and end_on properties that represent
the period of time that is being billed for.
In order to create a statements, I need to see which recurringcharges
occur within the statement period.
I’ve been racking my brains, but can’t seem to come up with the
elegant way to do this. Any ideas?