== About ice_cube ice_cube is a time recurrence library for Ruby. The API is modeled after iCalendar repeating events, making it very easy to describe complex rules and conjunctions in pure Ruby. ice_cube''s power lies in its ability to specify multiple rules - and easily query and expand them. Most importantly, ice_cube is fast, extremely expressive, and removes ugly complex date logic from your application. == Example Rule.yearly.day(:friday).day_of_month(13).month_of_year(:october) == Get ice_cube website: http://seejohnrun.github.com/ice_cube/ github: http://github.com/seejohnrun/ice_cube gem install ice_cube Thanks, John Crepezzi <john-T+CAy6JiQQdWk0Htik3J/w@public.gmane.org> -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Hi John. I like this library, it was just what I wanted. I am a newbie, i did not understand how to put dynamically the numbers of the days in the method IceCube::Rule.weekly i have try this under Ruby on Rails: ###################### all_days = [] all_days << 1 if params[:recurrent][:mon] all_days << 2 if params[:recurrent][:tue] all_days << 3 if params[:recurrent][:wed] all_days << 4 if params[:recurrent][:thu] all_days << 5 if params[:recurrent][:fri] all_days << 6 if params[:recurrent][:sat] all_days << 7 if params[:recurrent][:sun] schedule.add_recurrence_rule IceCube::Rule.weekly.day.all_days ##################### but i have an error thank you. -- Posted via http://www.ruby-forum.com/. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Sorry for the delay in response, for some reason I never got a notification.. Glad you like IceCube so far! First, the indexes in your code below should be 0-6, not 1-7 (where 0 is sunday) Also, you''re missing your add_recurrence_rule call -- should be: schedule.add_recurrence_rule IceCube::Rule.weekly.day(*all_days) --- So, your full code with modifications> all_days = [] > all_days << 1 if params[:recurrent][:sun] > all_days << 2 if params[:recurrent][:mon] > all_days << 3 if params[:recurrent][:tue] > all_days << 4 if params[:recurrent][:wed] > all_days << 5 if params[:recurrent][:thu] > all_days << 6 if params[:recurrent][:fri] > all_days << 7 if params[:recurrent][:sat] > > schedule.add_recurrence_rule IceCube::Rule.weekly.day(*all_days)--- Also, a little more crazy - if you change how your params arre named, to be :monday, :tuesday, etc... you could skip the "all_days" stuff, and just write: schedule.add_recurrence_rule IceCube::Rule.weekly.day(*params[:recurrent].keys) Since day accepts symbols like that as well as numbers like you did. Hope this helps! On May 29, 5:41 pm, Aldo Italo <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Hi John. > I like this library, it was just what I wanted. > I am a newbie, i did not understand how to put dynamically the numbers > of the days in the method IceCube::Rule.weekly > > i have try this under Ruby on Rails: > > ###################### > > all_days = [] > all_days << 1 if params[:recurrent][:mon] > all_days << 2 if params[:recurrent][:tue] > all_days << 3 if params[:recurrent][:wed] > all_days << 4 if params[:recurrent][:thu] > all_days << 5 if params[:recurrent][:fri] > all_days << 6 if params[:recurrent][:sat] > all_days << 7 if params[:recurrent][:sun] > > schedule.add_recurrence_rule IceCube::Rule.weekly.day.all_days > > ##################### > > but i have an error > thank you. > > -- > Posted viahttp://www.ruby-forum.com/.-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
This is a great gem, and probably the best starting point I could have hoped for in order to meet my project''s requirements - thanks a million for putting it together! I''m dealing with recurring events which can be both stuff like normal business hours (mon-fri 10-18 & sat 12-18) or more obscure ones (second sunday of every month 12-19). I''ve set up a simple model and associated form which generates rules for the starting times, and it all works very nicely indeed (I render the schedule to YAML before storing in DB). But then *doh* it hits me: there is no way to specify an end time other than the time when the recurring series as a whole should end. How do I go about giving each recurring event a time span? Many thanks, mikrogroove On 26 Apr, 23:25, John Crepezzi <john.crepe...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> == Aboutice_cubeice_cubeis a time recurrence library for Ruby. The API is modeled > after iCalendar repeating events, making it very easy to describe > complex rules and conjunctions in pure Ruby. ice_cube''spower lies in > its ability to specify multiple rules - and easily query and expand > them. Most importantly,ice_cubeis fast, extremely expressive, and > removes ugly complex date logic from your application. > > == Example > Rule.yearly.day(:friday).day_of_month(13).month_of_year(:october) > > == Getice_cube > website:http://seejohnrun.github.com/ice_cube/ > github: http://github.com/seejohnrun/ice_cube > > gem installice_cube > > Thanks, > John Crepezzi > <j...-T+CAy6JiQQdWk0Htik3J/w@public.gmane.org>-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Mikro, Thanks, I''m glad you like it :) Individual rules can take an end date as follows: rule = IceCube::Rule.weekly.until(Time.local(2010, 10, 6)) Just a note: Until times are inclusive. Hope this helps! Thanks, John Crepezzi <john.crepezzi-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> On Jun 1, 5:43 am, mikrogroove <o...-ghLYL0gzFSECT2ftz+WiyQ@public.gmane.org> wrote:> This is a great gem, and probably the best starting point I could have > hoped for in order to meet my project''s requirements - thanks a > million for putting it together! > > I''m dealing with recurring events which can be both stuff like normal > business hours (mon-fri 10-18 & sat 12-18) or more obscure ones > (second sunday of every month 12-19). I''ve set up a simple model and > associated form which generates rules for the starting times, and it > all works very nicely indeed (I render the schedule to YAML before > storing in DB). But then *doh* it hits me: there is no way to specify > an end time other than the time when the recurring series as a whole > should end. How do I go about giving each recurring event a time > span? > > Many thanks, > > mikrogroove > > On 26 Apr, 23:25, John Crepezzi <john.crepe...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > == Aboutice_cubeice_cubeis a time recurrence library for Ruby. The API is modeled > > after iCalendar repeating events, making it very easy to describe > > complex rules and conjunctions in pure Ruby. ice_cube''spower lies in > > its ability to specify multiple rules - and easily query and expand > > them. Most importantly,ice_cubeis fast, extremely expressive, and > > removes ugly complex date logic from your application. > > > == Example > > Rule.yearly.day(:friday).day_of_month(13).month_of_year(:october) > > > == Getice_cube > > website:http://seejohnrun.github.com/ice_cube/ > > github: http://github.com/seejohnrun/ice_cube > > > gem installice_cube > > > Thanks, > > John Crepezzi > > <j...-T+CAy6JiQQdWk0Htik3J/w@public.gmane.org>-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Hi John, Many thanks for your quick reply! I knew about the .until() option, but it''s not quite what I was after though. From the readme: "Individual rules may optionally specify an until date, which is a date that that individual rule is no longer effective". I need the rule to remain effective for the next occurrence of the event. Think of it this way: what if I have a weekly meeting every Monday between 9.30am and 10.30am and I do .occurs_at?(Time.now) on a Monday @ 10am? What I''m after is a way to specify the duration of each occurrence, but perhaps I''m better off storing this separately? But then how to deal with a schedule with multiple rules (where each rule might have a different duration)? Cheers, mikrogroove On 1 June, 15:14, John Crepezzi <john.crepe...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Mikro, > > Thanks, I''m glad you like it :) > > Individual rules can take an end date as follows: > rule = IceCube::Rule.weekly.until(Time.local(2010, 10, 6)) > > Just a note: Until times are inclusive. > > Hope this helps! > Thanks, > John Crepezzi <john.crepe...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > > On Jun 1, 5:43 am, mikrogroove <o...-ghLYL0gzFSECT2ftz+WiyQ@public.gmane.org> wrote: > > > This is a great gem, and probably the best starting point I could have > > hoped for in order to meet my project''s requirements - thanks a > > million for putting it together! > > > I''m dealing with recurring events which can be both stuff like normal > > business hours (mon-fri 10-18 & sat 12-18) or more obscure ones > > (second sunday of every month 12-19). I''ve set up a simple model and > > associated form which generates rules for the starting times, and it > > all works very nicely indeed (I render the schedule to YAML before > > storing in DB). But then *doh* it hits me: there is no way to specify > > an end time other than the time when the recurring series as a whole > > should end. How do I go about giving each recurring event a time > > span? > > > Many thanks, > > > mikrogroove > > > On 26 Apr, 23:25, John Crepezzi <john.crepe...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > == Aboutice_cubeice_cubeis a time recurrence library for Ruby. The API is modeled > > > after iCalendar repeating events, making it very easy to describe > > > complex rules and conjunctions in pure Ruby. ice_cube''spower lies in > > > its ability to specify multiple rules - and easily query and expand > > > them. Most importantly,ice_cubeis fast, extremely expressive, and > > > removes ugly complex date logic from your application. > > > > == Example > > > Rule.yearly.day(:friday).day_of_month(13).month_of_year(:october) > > > > == Getice_cube > > > website:http://seejohnrun.github.com/ice_cube/ > > > github: http://github.com/seejohnrun/ice_cube > > > > gem installice_cube > > > > Thanks, > > > John Crepezzi > > > <j...-T+CAy6JiQQdWk0Htik3J/w@public.gmane.org>-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Yep, since ice_cube is made for occurrences and not durations - you''d have to store these separately. I''m working with a branch now that will support end_times for rules, so you could call occurring_at? (Time.now) on a rule and see if it occurs anywhere in the duration. I''ll have this ready in the next few days Thanks, John C On Jun 1, 3:02 pm, mikrogroove <o...-ghLYL0gzFSECT2ftz+WiyQ@public.gmane.org> wrote:> Hi John, > > Many thanks for your quick reply! I knew about the .until() option, > but it''s not quite what I was after though. From the readme: > "Individual rules may optionally specify an until date, which is a > date that that individual rule is no longer effective". I need the > rule to remain effective for the next occurrence of the event. Think > of it this way: what if I have a weekly meeting every Monday between > 9.30am and 10.30am and I do .occurs_at?(Time.now) on a Monday @ 10am? > What I''m after is a way to specify the duration of each occurrence, > but perhaps I''m better off storing this separately? But then how to > deal with a schedule with multiple rules (where each rule might have a > different duration)? > > Cheers, > > mikrogroove > > On 1 June, 15:14, John Crepezzi <john.crepe...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > Mikro, > > > Thanks, I''m glad you like it :) > > > Individual rules can take an end date as follows: > > rule = IceCube::Rule.weekly.until(Time.local(2010, 10, 6)) > > > Just a note: Until times are inclusive. > > > Hope this helps! > > Thanks, > > John Crepezzi <john.crepe...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > > > On Jun 1, 5:43 am, mikrogroove <o...-ghLYL0gzFSECT2ftz+WiyQ@public.gmane.org> wrote: > > > > This is a great gem, and probably the best starting point I could have > > > hoped for in order to meet my project''s requirements - thanks a > > > million for putting it together! > > > > I''m dealing with recurring events which can be both stuff like normal > > > business hours (mon-fri 10-18 & sat 12-18) or more obscure ones > > > (second sunday of every month 12-19). I''ve set up a simple model and > > > associated form which generates rules for the starting times, and it > > > all works very nicely indeed (I render the schedule to YAML before > > > storing in DB). But then *doh* it hits me: there is no way to specify > > > an end time other than the time when the recurring series as a whole > > > should end. How do I go about giving each recurring event a time > > > span? > > > > Many thanks, > > > > mikrogroove > > > > On 26 Apr, 23:25, John Crepezzi <john.crepe...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > == Aboutice_cubeice_cubeis a time recurrence library for Ruby. The API is modeled > > > > after iCalendar repeating events, making it very easy to describe > > > > complex rules and conjunctions in pure Ruby. ice_cube''spower lies in > > > > its ability to specify multiple rules - and easily query and expand > > > > them. Most importantly,ice_cubeis fast, extremely expressive, and > > > > removes ugly complex date logic from your application. > > > > > == Example > > > > Rule.yearly.day(:friday).day_of_month(13).month_of_year(:october) > > > > > == Getice_cube > > > > website:http://seejohnrun.github.com/ice_cube/ > > > > github: http://github.com/seejohnrun/ice_cube > > > > > gem installice_cube > > > > > Thanks, > > > > John Crepezzi > > > > <j...-T+CAy6JiQQdWk0Htik3J/w@public.gmane.org>-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
That is awesome news John, I am sure this will become a hugely popular gem - it''s almost a complete calendaring system in a box! I wish my skills were up to a level where I could offer to help, but I fear I''d just mess things up for you :s Please know that your efforts are greatly appreciated! mikrogroove On 1 June, 22:19, John Crepezzi <john.crepe...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Yep, since ice_cube is made for occurrences and not durations - you''d > have to store these separately. I''m working with a branch now that > will support end_times for rules, so you could call occurring_at? > (Time.now) on a rule and see if it occurs anywhere in the duration. > > I''ll have this ready in the next few days > Thanks, > John C > > On Jun 1, 3:02 pm, mikrogroove <o...-ghLYL0gzFSECT2ftz+WiyQ@public.gmane.org> wrote: > > > Hi John, > > > Many thanks for your quick reply! I knew about the .until() option, > > but it''s not quite what I was after though. From the readme: > > "Individual rules may optionally specify an until date, which is a > > date that that individual rule is no longer effective". I need the > > rule to remain effective for the next occurrence of the event. Think > > of it this way: what if I have a weekly meeting every Monday between > > 9.30am and 10.30am and I do .occurs_at?(Time.now) on a Monday @ 10am? > > What I''m after is a way to specify the duration of each occurrence, > > but perhaps I''m better off storing this separately? But then how to > > deal with a schedule with multiple rules (where each rule might have a > > different duration)? > > > Cheers, > > > mikrogroove > > > On 1 June, 15:14, John Crepezzi <john.crepe...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > Mikro, > > > > Thanks, I''m glad you like it :) > > > > Individual rules can take an end date as follows: > > > rule = IceCube::Rule.weekly.until(Time.local(2010, 10, 6)) > > > > Just a note: Until times are inclusive. > > > > Hope this helps! > > > Thanks, > > > John Crepezzi <john.crepe...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > > > > On Jun 1, 5:43 am, mikrogroove <o...-ghLYL0gzFSECT2ftz+WiyQ@public.gmane.org> wrote: > > > > > This is a great gem, and probably the best starting point I could have > > > > hoped for in order to meet my project''s requirements - thanks a > > > > million for putting it together! > > > > > I''m dealing with recurring events which can be both stuff like normal > > > > business hours (mon-fri 10-18 & sat 12-18) or more obscure ones > > > > (second sunday of every month 12-19). I''ve set up a simple model and > > > > associated form which generates rules for the starting times, and it > > > > all works very nicely indeed (I render the schedule to YAML before > > > > storing in DB). But then *doh* it hits me: there is no way to specify > > > > an end time other than the time when the recurring series as a whole > > > > should end. How do I go about giving each recurring event a time > > > > span? > > > > > Many thanks, > > > > > mikrogroove > > > > > On 26 Apr, 23:25, John Crepezzi <john.crepe...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > == Aboutice_cubeice_cubeis a time recurrence library for Ruby. The API is modeled > > > > > after iCalendar repeating events, making it very easy to describe > > > > > complex rules and conjunctions in pure Ruby. ice_cube''spower lies in > > > > > its ability to specify multiple rules - and easily query and expand > > > > > them. Most importantly,ice_cubeis fast, extremely expressive, and > > > > > removes ugly complex date logic from your application. > > > > > > == Example > > > > > Rule.yearly.day(:friday).day_of_month(13).month_of_year(:october) > > > > > > == Getice_cube > > > > > website:http://seejohnrun.github.com/ice_cube/ > > > > > github: http://github.com/seejohnrun/ice_cube > > > > > > gem installice_cube > > > > > > Thanks, > > > > > John Crepezzi > > > > > <j...-T+CAy6JiQQdWk0Htik3J/w@public.gmane.org>-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
@John: Just wanted to check if there''s any progress on the end_times support? Many thanks, mikrogroove On 1 June, 22:50, mikrogroove <o...-ghLYL0gzFSECT2ftz+WiyQ@public.gmane.org> wrote:> That is awesome news John, I am sure this will become a hugely popular > gem - it''s almost a complete calendaring system in a box! I wish my > skills were up to a level where I could offer to help, but I fear I''d > just mess things up for you :s Please know that your efforts are > greatly appreciated! > > mikrogroove > > On 1 June, 22:19, John Crepezzi <john.crepe...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > Yep, sinceice_cubeis made for occurrences and not durations - you''d > > have to store these separately. I''m working with a branch now that > > will support end_times for rules, so you could call occurring_at? > > (Time.now) on a rule and see if it occurs anywhere in the duration. > > > I''ll have this ready in the next few days > > Thanks, > > John C > > > On Jun 1, 3:02 pm, mikrogroove <o...-ghLYL0gzFSECT2ftz+WiyQ@public.gmane.org> wrote: > > > > Hi John, > > > > Many thanks for your quick reply! I knew about the .until() option, > > > but it''s not quite what I was after though. From the readme: > > > "Individual rules may optionally specify an until date, which is a > > > date that that individual rule is no longer effective". I need the > > > rule to remain effective for the next occurrence of the event. Think > > > of it this way: what if I have a weekly meeting every Monday between > > > 9.30am and 10.30am and I do .occurs_at?(Time.now) on a Monday @ 10am? > > > What I''m after is a way to specify the duration of each occurrence, > > > but perhaps I''m better off storing this separately? But then how to > > > deal with a schedule with multiple rules (where each rule might have a > > > different duration)? > > > > Cheers, > > > > mikrogroove > > > > On 1 June, 15:14, John Crepezzi <john.crepe...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > Mikro, > > > > > Thanks, I''m glad you like it :) > > > > > Individual rules can take an end date as follows: > > > > rule = IceCube::Rule.weekly.until(Time.local(2010, 10, 6)) > > > > > Just a note: Until times are inclusive. > > > > > Hope this helps! > > > > Thanks, > > > > John Crepezzi <john.crepe...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > > > > > On Jun 1, 5:43 am, mikrogroove <o...-ghLYL0gzFSECT2ftz+WiyQ@public.gmane.org> wrote: > > > > > > This is a great gem, and probably the best starting point I could have > > > > > hoped for in order to meet my project''s requirements - thanks a > > > > > million for putting it together! > > > > > > I''m dealing with recurring events which can be both stuff like normal > > > > > business hours (mon-fri 10-18 & sat 12-18) or more obscure ones > > > > > (second sunday of every month 12-19). I''ve set up a simple model and > > > > > associated form which generates rules for the starting times, and it > > > > > all works very nicely indeed (I render the schedule to YAML before > > > > > storing in DB). But then *doh* it hits me: there is no way to specify > > > > > an end time other than the time when the recurring series as a whole > > > > > should end. How do I go about giving each recurring event a time > > > > > span? > > > > > > Many thanks, > > > > > > mikrogroove > > > > > > On 26 Apr, 23:25, John Crepezzi <john.crepe...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > > == Aboutice_cubeice_cubeis a time recurrence library for Ruby. The API is modeled > > > > > > after iCalendar repeating events, making it very easy to describe > > > > > > complex rules and conjunctions in pure Ruby. ice_cube''spower lies in > > > > > > its ability to specify multiple rules - and easily query and expand > > > > > > them. Most importantly,ice_cubeis fast, extremely expressive, and > > > > > > removes ugly complex date logic from your application. > > > > > > > == Example > > > > > > Rule.yearly.day(:friday).day_of_month(13).month_of_year(:october) > > > > > > > == Getice_cube > > > > > > website:http://seejohnrun.github.com/ice_cube/ > > > > > > github: http://github.com/seejohnrun/ice_cube > > > > > > > gem installice_cube > > > > > > > Thanks, > > > > > > John Crepezzi > > > > > > <j...-T+CAy6JiQQdWk0Htik3J/w@public.gmane.org>-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
@mikrogroove I need a few days to finish up the testing, and then I''ll have this out for you. Thanks for your patience! Also, check out the addition of :duration in the README, if you haven''t already. May help you get started Thanks, John Crepezzi On Jun 21, 10:36 am, mikrogroove <o...-ghLYL0gzFSECT2ftz+WiyQ@public.gmane.org> wrote:> @John: Just wanted to check if there''s any progress on the end_times > support? > > Many thanks, > > mikrogroove > > On 1 June, 22:50, mikrogroove <o...-ghLYL0gzFSECT2ftz+WiyQ@public.gmane.org> wrote: > > > > > That is awesome news John, I am sure this will become a hugely popular > > gem - it''s almost a complete calendaring system in a box! I wish my > > skills were up to a level where I could offer to help, but I fear I''d > > just mess things up for you :s Please know that your efforts are > > greatly appreciated! > > > mikrogroove > > > On 1 June, 22:19, John Crepezzi <john.crepe...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > Yep, sinceice_cubeis made for occurrences and not durations - you''d > > > have to store these separately. I''m working with a branch now that > > > will support end_times for rules, so you could call occurring_at? > > > (Time.now) on a rule and see if it occurs anywhere in the duration. > > > > I''ll have this ready in the next few days > > > Thanks, > > > John C > > > > On Jun 1, 3:02 pm, mikrogroove <o...-ghLYL0gzFSECT2ftz+WiyQ@public.gmane.org> wrote: > > > > > Hi John, > > > > > Many thanks for your quick reply! I knew about the .until() option, > > > > but it''s not quite what I was after though. From the readme: > > > > "Individual rules may optionally specify an until date, which is a > > > > date that that individual rule is no longer effective". I need the > > > > rule to remain effective for the next occurrence of the event. Think > > > > of it this way: what if I have a weekly meeting every Monday between > > > > 9.30am and 10.30am and I do .occurs_at?(Time.now) on a Monday @ 10am? > > > > What I''m after is a way to specify the duration of each occurrence, > > > > but perhaps I''m better off storing this separately? But then how to > > > > deal with a schedule with multiple rules (where each rule might have a > > > > different duration)? > > > > > Cheers, > > > > > mikrogroove > > > > > On 1 June, 15:14, John Crepezzi <john.crepe...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > Mikro, > > > > > > Thanks, I''m glad you like it :) > > > > > > Individual rules can take an end date as follows: > > > > > rule = IceCube::Rule.weekly.until(Time.local(2010, 10, 6)) > > > > > > Just a note: Until times are inclusive. > > > > > > Hope this helps! > > > > > Thanks, > > > > > John Crepezzi <john.crepe...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > > > > > > On Jun 1, 5:43 am, mikrogroove <o...-ghLYL0gzFSECT2ftz+WiyQ@public.gmane.org> wrote: > > > > > > > This is a great gem, and probably the best starting point I could have > > > > > > hoped for in order to meet my project''s requirements - thanks a > > > > > > million for putting it together! > > > > > > > I''m dealing with recurring events which can be both stuff like normal > > > > > > business hours (mon-fri 10-18 & sat 12-18) or more obscure ones > > > > > > (second sunday of every month 12-19). I''ve set up a simple model and > > > > > > associated form which generates rules for the starting times, and it > > > > > > all works very nicely indeed (I render the schedule to YAML before > > > > > > storing in DB). But then *doh* it hits me: there is no way to specify > > > > > > an end time other than the time when the recurring series as a whole > > > > > > should end. How do I go about giving each recurring event a time > > > > > > span? > > > > > > > Many thanks, > > > > > > > mikrogroove > > > > > > > On 26 Apr, 23:25, John Crepezzi <john.crepe...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > > > == Aboutice_cubeice_cubeis a time recurrence library for Ruby. The API is modeled > > > > > > > after iCalendar repeating events, making it very easy to describe > > > > > > > complex rules and conjunctions in pure Ruby. ice_cube''spower lies in > > > > > > > its ability to specify multiple rules - and easily query and expand > > > > > > > them. Most importantly,ice_cubeis fast, extremely expressive, and > > > > > > > removes ugly complex date logic from your application. > > > > > > > > == Example > > > > > > > Rule.yearly.day(:friday).day_of_month(13).month_of_year(:october) > > > > > > > > == Getice_cube > > > > > > > website:http://seejohnrun.github.com/ice_cube/ > > > > > > > github: http://github.com/seejohnrun/ice_cube > > > > > > > > gem installice_cube > > > > > > > > Thanks, > > > > > > > John Crepezzi > > > > > > > <j...-T+CAy6JiQQdWk0Htik3J/w@public.gmane.org>-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
I''m just having a look at this, as I''ve another need for recurrence-tracking. Previously I''ve used RiCal, but liked the look of IceCube as a little more lightweight. But I''m getting lots of error in my console with Dates being compared to Times, or missing "utc_offset" method.... have I missed something in the requirements for Ruby or Rails for this gem? I''m on Ruby 1.8.7 and Rails 2.3.2 (for this project). -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Can you give some more details? ice_cube''s times are expressed as Time(s) in Ruby. Maybe just some sample code? On Jun 23, 11:06 am, Michael Pavling <pavl...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I''m just having a look at this, as I''ve another need for > recurrence-tracking. Previously I''ve used RiCal, but liked the look of > IceCube as a little more lightweight. > But I''m getting lots of error in my console with Dates being compared > to Times, or missing "utc_offset" method.... have I missed something > in the requirements for Ruby or Rails for this gem? > > I''m on Ruby 1.8.7 and Rails 2.3.2 (for this project).-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 23 June 2010 16:53, John Crepezzi <john.crepezzi-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Can you give some more details? > ice_cube''s times are expressed as Time(s) in Ruby.I''m finding that - although it''s not clear from the readme (which just shows "end_date"). The methods accept Dates as parameters, and seem to populate okay.. things just break later!> Maybe just some sample code?If there''s anything that I stumble over again, I''ll prepare a snippet of code as an example. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
@mikrogroove ice_cube v0.4 just came out with end time support and a few bug fixes. I''m adding details for adding end_time to a schedule now Thanks, John C On Jun 22, 10:25 pm, John Crepezzi <john.crepe...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> @mikrogroove > > I need a few days to finish up the testing, and then I''ll have this > out for you. > Thanks for your patience! > > Also, check out the addition of :duration in the README, if you > haven''t already. May help you get started > > Thanks, > John Crepezzi > > On Jun 21, 10:36 am, mikrogroove <o...-ghLYL0gzFSECT2ftz+WiyQ@public.gmane.org> wrote: > > > > > @John: Just wanted to check if there''s any progress on the end_times > > support? > > > Many thanks, > > > mikrogroove > > > On 1 June, 22:50, mikrogroove <o...-ghLYL0gzFSECT2ftz+WiyQ@public.gmane.org> wrote: > > > > That is awesome news John, I am sure this will become a hugely popular > > > gem - it''s almost a complete calendaring system in a box! I wish my > > > skills were up to a level where I could offer to help, but I fear I''d > > > just mess things up for you :s Please know that your efforts are > > > greatly appreciated! > > > > mikrogroove > > > > On 1 June, 22:19, John Crepezzi <john.crepe...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > Yep, sinceice_cubeis made for occurrences and not durations - you''d > > > > have to store these separately. I''m working with a branch now that > > > > will support end_times for rules, so you could call occurring_at? > > > > (Time.now) on a rule and see if it occurs anywhere in the duration. > > > > > I''ll have this ready in the next few days > > > > Thanks, > > > > John C > > > > > On Jun 1, 3:02 pm, mikrogroove <o...-ghLYL0gzFSECT2ftz+WiyQ@public.gmane.org> wrote: > > > > > > Hi John, > > > > > > Many thanks for your quick reply! I knew about the .until() option, > > > > > but it''s not quite what I was after though. From the readme: > > > > > "Individual rules may optionally specify an until date, which is a > > > > > date that that individual rule is no longer effective". I need the > > > > > rule to remain effective for the next occurrence of the event. Think > > > > > of it this way: what if I have a weekly meeting every Monday between > > > > > 9.30am and 10.30am and I do .occurs_at?(Time.now) on a Monday @ 10am? > > > > > What I''m after is a way to specify the duration of each occurrence, > > > > > but perhaps I''m better off storing this separately? But then how to > > > > > deal with a schedule with multiple rules (where each rule might have a > > > > > different duration)? > > > > > > Cheers, > > > > > > mikrogroove > > > > > > On 1 June, 15:14, John Crepezzi <john.crepe...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > > Mikro, > > > > > > > Thanks, I''m glad you like it :) > > > > > > > Individual rules can take an end date as follows: > > > > > > rule = IceCube::Rule.weekly.until(Time.local(2010, 10, 6)) > > > > > > > Just a note: Until times are inclusive. > > > > > > > Hope this helps! > > > > > > Thanks, > > > > > > John Crepezzi <john.crepe...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > > > > > > > On Jun 1, 5:43 am, mikrogroove <o...-ghLYL0gzFSECT2ftz+WiyQ@public.gmane.org> wrote: > > > > > > > > This is a great gem, and probably the best starting point I could have > > > > > > > hoped for in order to meet my project''s requirements - thanks a > > > > > > > million for putting it together! > > > > > > > > I''m dealing with recurring events which can be both stuff like normal > > > > > > > business hours (mon-fri 10-18 & sat 12-18) or more obscure ones > > > > > > > (second sunday of every month 12-19). I''ve set up a simple model and > > > > > > > associated form which generates rules for the starting times, and it > > > > > > > all works very nicely indeed (I render the schedule to YAML before > > > > > > > storing in DB). But then *doh* it hits me: there is no way to specify > > > > > > > an end time other than the time when the recurring series as a whole > > > > > > > should end. How do I go about giving each recurring event a time > > > > > > > span? > > > > > > > > Many thanks, > > > > > > > > mikrogroove > > > > > > > > On 26 Apr, 23:25, John Crepezzi <john.crepe...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > > > > == Aboutice_cubeice_cubeis a time recurrence library for Ruby. The API is modeled > > > > > > > > after iCalendar repeating events, making it very easy to describe > > > > > > > > complex rules and conjunctions in pure Ruby. ice_cube''spower lies in > > > > > > > > its ability to specify multiple rules - and easily query and expand > > > > > > > > them. Most importantly,ice_cubeis fast, extremely expressive, and > > > > > > > > removes ugly complex date logic from your application. > > > > > > > > > == Example > > > > > > > > Rule.yearly.day(:friday).day_of_month(13).month_of_year(:october) > > > > > > > > > == Getice_cube > > > > > > > > website:http://seejohnrun.github.com/ice_cube/ > > > > > > > > github: http://github.com/seejohnrun/ice_cube > > > > > > > > > gem installice_cube > > > > > > > > > Thanks, > > > > > > > > John Crepezzi > > > > > > > > <j...-T+CAy6JiQQdWk0Htik3J/w@public.gmane.org>-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
First of all, your plugin is just great! Although: How am I able to rule opening hours of a restaurant within single Schedule? Mon-Fri 8-16 is quite easy but schedule = Schedule.new(Time.parse(Date.yesterday.to_s + '' 8:00''), :duration => 60*60*8) (...) schedule.add_recurrence_rule Rule.daily.day(:wednesday) schedule.add_recurrence_rule Rule.daily.day(:thursday) (...) raise schedule.occurring_at?(Time.now).inspect Problem is when trying to rule something like: Mon 9-17 Tu 16-01 (the next day after midnight) etc. Am I able to do this with that plugin? W dniu piątek, 25 czerwca 2010 18:47:03 UTC+2 użytkownik John Crepezzi napisał:> > @mikrogroove > > ice_cube v0.4 just came out with end time support and a few bug fixes. > I''m adding details for adding end_time to a schedule now > > Thanks, > John C > > On Jun 22, 10:25 pm, John Crepezzi <john.crepe...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > @mikrogroove > > > > I need a few days to finish up the testing, and then I''ll have this > > out for you. > > Thanks for your patience! > > > > Also, check out the addition of :duration in the README, if you > > haven''t already. May help you get started > > > > Thanks, > > John Crepezzi > > > > On Jun 21, 10:36 am, mikrogroove <o...-ghLYL0gzFSECT2ftz+WiyQ@public.gmane.org> wrote: > > > > > > > > > @John: Just wanted to check if there''s any progress on the end_times > > > support? > > > > > Many thanks, > > > > > mikrogroove > > > > > On 1 June, 22:50, mikrogroove <o...-ghLYL0gzFSECT2ftz+WiyQ@public.gmane.org> wrote: > > > > > > That is awesome news John, I am sure this will become a hugely > popular > > > > gem - it''s almost a complete calendaring system in a box! I wish my > > > > skills were up to a level where I could offer to help, but I fear > I''d > > > > just mess things up for you :s Please know that your efforts are > > > > greatly appreciated! > > > > > > mikrogroove > > > > > > On 1 June, 22:19, John Crepezzi <john.crepe...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > > Yep, sinceice_cubeis made for occurrences and not durations - > you''d > > > > > have to store these separately. I''m working with a branch now > that > > > > > will support end_times for rules, so you could call occurring_at? > > > > > (Time.now) on a rule and see if it occurs anywhere in the > duration. > > > > > > > I''ll have this ready in the next few days > > > > > Thanks, > > > > > John C > > > > > > > On Jun 1, 3:02 pm, mikrogroove <o...-ghLYL0gzFSECT2ftz+WiyQ@public.gmane.org> wrote: > > > > > > > > Hi John, > > > > > > > > Many thanks for your quick reply! I knew about the .until() > option, > > > > > > but it''s not quite what I was after though. From the readme: > > > > > > "Individual rules may optionally specify an until date, which is > a > > > > > > date that that individual rule is no longer effective". I need > the > > > > > > rule to remain effective for the next occurrence of the event. > Think > > > > > > of it this way: what if I have a weekly meeting every Monday > between > > > > > > 9.30am and 10.30am and I do .occurs_at?(Time.now) on a Monday @ > 10am? > > > > > > What I''m after is a way to specify the duration of each > occurrence, > > > > > > but perhaps I''m better off storing this separately? But then how > to > > > > > > deal with a schedule with multiple rules (where each rule might > have a > > > > > > different duration)? > > > > > > > > Cheers, > > > > > > > > mikrogroove > > > > > > > > On 1 June, 15:14, John Crepezzi <john.crepe...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > wrote: > > > > > > > > > Mikro, > > > > > > > > > Thanks, I''m glad you like it :) > > > > > > > > > Individual rules can take an end date as follows: > > > > > > > rule = IceCube::Rule.weekly.until(Time.local(2010, 10, 6)) > > > > > > > > > Just a note: Until times are inclusive. > > > > > > > > > Hope this helps! > > > > > > > Thanks, > > > > > > > John Crepezzi <john.crepe...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > > > > > > > > > On Jun 1, 5:43 am, mikrogroove <o...-ghLYL0gzFSECT2ftz+WiyQ@public.gmane.org> wrote: > > > > > > > > > > This is a great gem, and probably the best starting point I > could have > > > > > > > > hoped for in order to meet my project''s requirements - > thanks a > > > > > > > > million for putting it together! > > > > > > > > > > I''m dealing with recurring events which can be both stuff > like normal > > > > > > > > business hours (mon-fri 10-18 & sat 12-18) or more obscure > ones > > > > > > > > (second sunday of every month 12-19). I''ve set up a simple > model and > > > > > > > > associated form which generates rules for the starting > times, and it > > > > > > > > all works very nicely indeed (I render the schedule to YAML > before > > > > > > > > storing in DB). But then *doh* it hits me: there is no way > to specify > > > > > > > > an end time other than the time when the recurring series as > a whole > > > > > > > > should end. How do I go about giving each recurring event a > time > > > > > > > > span? > > > > > > > > > > Many thanks, > > > > > > > > > > mikrogroove > > > > > > > > > > On 26 Apr, 23:25, John Crepezzi <john.crepe...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > wrote: > > > > > > > > > > > == Aboutice_cubeice_cubeis a time recurrence library for > Ruby. The API is modeled > > > > > > > > > after iCalendar repeating events, making it very easy to > describe > > > > > > > > > complex rules and conjunctions in pure Ruby. > ice_cube''spower lies in > > > > > > > > > its ability to specify multiple rules - and easily query > and expand > > > > > > > > > them. Most importantly,ice_cubeis fast, extremely > expressive, and > > > > > > > > > removes ugly complex date logic from your application. > > > > > > > > > > > == Example > > > > > > > > > > Rule.yearly.day(:friday).day_of_month(13).month_of_year(:october) > > > > > > > > > > > == Getice_cube > > > > > > > > > website:http://seejohnrun.github.com/ice_cube/ > > > > > > > > > github: http://github.com/seejohnrun/ice_cube > > > > > > > > > > > gem installice_cube > > > > > > > > > > > Thanks, > > > > > > > > > John Crepezzi > > > > > > > > > <j...-T+CAy6JiQQdWk0Htik3J/w@public.gmane.org>-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/JXrmwljShkQJ. For more options, visit https://groups.google.com/groups/opt_out.