Nowadays we are pretty conservative in general adding core extensions. But dates have a bunch of methods that conform a calculations API in which your proposal makes sense in my view.
Please cc me in the PR! On Saturday, 28 May 2016, Oreoluwa Akinniranye <reico...@gmail.com> wrote: > I'd be happy to submit a PR if anyone thinks this makes some sense. > > On Saturday, May 28, 2016 at 6:58:54 PM UTC+1, Oreoluwa Akinniranye wrote: >> >> date = Date.today >> tuesday = date.next_week(:tuesday) >> returns the next week's occurrence of Tuesday, relative to today(the date >> instance). >> >> At times, this may not be the required result, e.g if today were a >> Monday, I might just need Tuesday, it would be convenient to have something >> like: >> >> date = Date.today >> tuesday = date.next_tuesday >> if date is Monday, tuesday should return tomorrow and not necessarily >> next week's Tuesday as currently provided by next_week >> >> This would be useful largely in scheduling applications >> > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Core" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to rubyonrails-core+unsubscr...@googlegroups.com > <javascript:_e(%7B%7D,'cvml','rubyonrails-core%2bunsubscr...@googlegroups.com');> > . > To post to this group, send email to rubyonrails-core@googlegroups.com > <javascript:_e(%7B%7D,'cvml','rubyonrails-core@googlegroups.com');>. > Visit this group at https://groups.google.com/group/rubyonrails-core. > For more options, visit https://groups.google.com/d/optout. > -- Sent from Gmail Mobile -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-core+unsubscr...@googlegroups.com. To post to this group, send email to rubyonrails-core@googlegroups.com. Visit this group at https://groups.google.com/group/rubyonrails-core. For more options, visit https://groups.google.com/d/optout.