Jonathan Viney
2006-Sep-20 06:03 UTC
[ANN] date_finder plugin: Find dates that match conditions
I couldn''t find any existing solutions to this problem so .... here''s what this plugin can do for you: To find the next five Mondays and Fridays: DateFinderBase.weekly.day(:monday).day(:friday).find(:max => 5) To find the 10th of the month for the next five months: DateFinderBase.monthly.day_number(10).find(:max => 5) To find the last Thursday in September for the next 3 years DateFinderBase.yearly.month(:september).day(:thursday).day_occurrence(:last).find(:max => 3) To find the next 5 Wednesdays on a fortnightly basis (skips every second week): DateFinderBase.weekly(2).day(:wednesday).find(:max => 5) script/plugin install http://svn.viney.net.nz/things/rails/plugins/date_finder Feedback welcome. -Jonathan. --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
D. Taylor Singletary
2006-Sep-20 18:56 UTC
Re: [ANN] date_finder plugin: Find dates that match conditions
This is one of the best plugins I''ve seen in a while. Thanks! On 9/19/06, Jonathan Viney <jonathan.viney-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > I couldn''t find any existing solutions to this problem so .... here''s what > this plugin can do for you: > > To find the next five Mondays and Fridays: > DateFinderBase.weekly.day(:monday).day(:friday).find(:max => 5) > > To find the 10th of the month for the next five months: > DateFinderBase.monthly.day_number(10).find(:max => 5) > > To find the last Thursday in September for the next 3 years > DateFinderBase.yearly.month(:september).day(:thursday).day_occurrence(:last).find(:max => 3) > > To find the next 5 Wednesdays on a fortnightly basis (skips every second > week): > DateFinderBase.weekly(2).day(:wednesday).find(:max => 5) > > script/plugin install > http://svn.viney.net.nz/things/rails/plugins/date_finder > > Feedback welcome. > > -Jonathan. > > > >-- D. Taylor Singletary Reality Technician "Look at my hair; like the design." -- David Byrne --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
Peter Cutting
2006-Dec-14 13:20 UTC
Re: [ANN] date_finder plugin: Find dates that match conditions
Hi Does Date_finder support weeks 1-52? note that Week 1 must contain 4th Jan Peter --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---