I have a simple timeclock application with an Admin page. I’m trying to
find an easy way to select a range of record from the database. For
instance “This week”, “Last week”, or “Last month” without having to
manually calculate the dates. This is what I’ve come up with, but it
does require me to manually calculate everything:
Thanks for the reply. The selection code is working fine. What I’m
trying to avoid is having to manually calculate the values of startFrame
and endFrame. Is there a method or something in rails to just say select
all record within the last week but not prior to Sunday? So if it is
Wednesday today I would get the records for Monday, Tuesday, and
Wednesday.
I know I can calculate the values with a bunch of code-fu but I’d like
to avoid it if I can.
Thanks for the reply. The selection code is working fine. What I’m
trying to avoid is having to manually calculate the values of startFrame
and endFrame. Is there a method or something in rails to just say select
all record within the last week but not prior to Sunday? So if it is
Wednesday today I would get the records for Monday, Tuesday, and
Wednesday.
I know I can calculate the values with a bunch of code-fu but I’d like
to avoid it if I can.