From: Gary Wright Date: 2010-02-10T05:35:35+09:00 Subject: Re: [Q] algorithm to truncate date to beginning of week? On Feb 9, 2010, at 2:22 PM, Chuck Remes wrote: > > Ooh, all of ActiveSupport for a little date manipulation? Nail, meet hammer! Of course reinventing the wheel isn't necessarily a good thing either. Here is another approach: >> require 'chronic' => true >> Time.now => Tue Feb 09 15:31:25 -0500 2010 >> Chronic.parse 'midnight last saturday' => Sun Feb 07 00:00:00 -0500 2010 >> Chronic.parse 'midnight last saturday', :now => Date.parse('12/25/2010') => Sun Dec 19 00:00:00 -0500 2010