On May 21, 2009, at 10:22 AM, Rick DeNatale wrote: > On Thu, May 21, 2009 at 12:08 AM, Rob Biedenharn > <[email protected]> wrote: >> >> You can look at the next_week method >> >> http://www.railsbrain.com/api/rails-2.3.2/doc/index.html?a=M001363&name=next_week >> >> and then back off a week. You could also take the code and create >> your >> own method like the beginning_of_week if it doesn't already do >> exactly >> what you want. > > Well since this is the Rails forum and not the Ruby forum, > Time#beginning_of_week is already defined in ActiveSupport. > > -- > Rick DeNatale > > Blog: http://talklikeaduck.denhaven2.com/ > Twitter: http://twitter.com/RickDeNatale > WWR: http://www.workingwithrails.com/person/9021-rick-denatale > LinkedIn: http://www.linkedin.com/in/rickdenatale
I guess I didn't make my point very well. (Even I can't see it from what I actually *wrote*.) The Time#next_week in ActiveSupport lets you specify the day that starts the week while Time#beginning_of_week always goes back to Monday. My reference to Time#beginning_of_week was perhaps a bit too implicit and I suppose I was relying on the clairvoyance of the OP for the point about choosing when the "week" begins. -Rob Rob Biedenharn http://agileconsultingllc.com [email protected] --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---

