I’m working on an invoicing program and need a bit of help working
with dates. Given a start date, end date, and frequency (i.e.,
weekly, monthly, quarterly), I need to be able to figure out the
“window” that a certain date fits in.
For example, if charges are monthly and start on 1/1/07, I need a way
to figure out that 3/4/2007 is in the window of 3/1/2007 through
Or if charges are weekly and start on 1/1/07, I need a way to figure
out that 1/10/2007 is in the window of 1/7/2007 through 1/13/2007.
I’m sure Ruby/Rails has a clever way to handle this, and would really
appreciate any help.