Questions tagged [ice-cube]

ice_cube is a ruby library for easily handling repeated events (schedules). The API is modeled after iCalendar repeated dates.

ice_cube is a ruby library for easily handling repeated events (schedules). The API is modeled after iCalendar repeated dates.

Resources:

47 questions
8
votes
1 answer

ice_cube and recurring_select gems and occurrences

I'm attempting to utilize the [awesome] functionality of ice_cube and recurring_select gems to handle recurring events. I've got a schedule (text) column in my database and the following in the event model: def schedule=(new_schedule) …
Jayson Lane
  • 2,828
  • 1
  • 24
  • 39
7
votes
2 answers

Efficiently retrieving ice_cube schedules for a given time period

I'm looking into using Ice Cube https://github.com/seejohnrun/ice_cube for recurring events. My question is, if I then need to get any events that fall within a given time period (say, on a day or within a week), is there any better way than to loop…
99miles
  • 10,942
  • 18
  • 78
  • 123
6
votes
3 answers

Using ice_cube Ruby gem in IRB

I'm trying to use a Ruby gem called ice_cube in IRB, but it doesn't work: [~]$ rvm gemset create ice 'ice' gemset created (/home/joe/.rvm/gems/ruby-1.9.2-p320@ice). [~]$ rvm gemset use ice Using ruby-1.9.2-p320 with gemset ice [~]$ gem install…
Asher Walther
  • 1,327
  • 2
  • 9
  • 13
5
votes
1 answer

gem ice_cube for reccurence events

I have simple Event model (title, date, user) And I created Events Calendar by months (gem 'watu_table_builder'). I need the feature to create repeating events. I figured out that I may use gem ice_cube for it. But it is not clear for me. I added to…
Gabi
  • 250
  • 1
  • 4
  • 13
4
votes
2 answers

Single occurrence event with ice_cube gem using start_time and end_time

There must be something simple being overlooked here... I've been trying various methods for creating a basic IceCube schedule (https://github.com/seejohnrun/ice_cube). The overall goal is to use IceCube to allow "price schedules" inside a "room…
b2tech
  • 75
  • 1
  • 7
3
votes
1 answer

Ruby/ice_cube: Exclude whole day for hourly recurring event

Just started playing around with ice_cube I've got a weekly schedule (with a granularity of half an hour) created schedule = IceCube::Schedule.new(Time.now.change(:min => 30)) with several rules (let's say 20) such as…
polarblau
  • 17,649
  • 7
  • 63
  • 84
3
votes
1 answer

creating recurring events with ice_cube gem

I am trying to create recurring events using ice_cube and recurring_select gems. Here is my _form.html.erb code: <%= simple_form_for(@event) do |f| %>
<%= f.select_recurring :day, [IceCube::Rule.daily] %> <%=…
Paulina
  • 61
  • 4
3
votes
1 answer

Calculate the intersection of two arrays of ranges (of dates) in ruby

Given two large arrays of ranges... A = [0..23, 30..53, 60..83, 90..113] B = [-Float::INFINITY..13, 25..33, 45..53, 65..73, 85..93] When I do a logical conjuction... C = A.mask(B) Then I expect describe "Array#mask" do it{expect(C =…
Kevin Monk
  • 1,434
  • 1
  • 16
  • 23
3
votes
1 answer

Opening hours in ice_cube

How am I able to rule opening hours of a restaurant within single Schedule? Mon-Fri 8-16 is quite easy: schedule = Schedule.new(Time.parse(Date.yesterday.to_s + ' 8:00'), :duration => 60*60*8) (...) schedule.add_recurrence_rule…
zewlak
  • 61
  • 9
2
votes
1 answer

Identify the ice_cube schedule

i would like to identify the details of an schedule. e.g: i have the schedule for an event: event.schedule "Every 3 months on the 10th day of the month" represented by the hash: { :start_date=>2012-02-06 10:37:04 +0100, :rrules=>[{ …
fluxsaas
  • 997
  • 2
  • 11
  • 27
2
votes
1 answer

Recurring events on event_calendar

I am trying to implement recurring events for event_calendar and it is turing out to be quite challenge. It seem I have to write the recurrence for my events from scratch. I have no problem with that as long as I am not missing a better way of doing…
Yuri
  • 1,261
  • 1
  • 11
  • 23
2
votes
1 answer

How can I return validation errors for objects created after_save?

I'm writing a booking system which handles recurring bookings using the ice_cube gem. A Booking has_many BookingItems, one for each occurrence in the recurrence rule, and these are created in a method which is called by Booking's after_save…
Simon
  • 1,716
  • 1
  • 21
  • 37
1
vote
0 answers

How can I configure a global count limit with ice_cube gem?

I'm configuring recurring events with ice_cube gem and sometimes we need to configure an event with more than one rule. In those cases I only found how to store the count for each rule, but I need a 'global' count limit. I tried this example: I want…
rogeryc
  • 23
  • 8
1
vote
1 answer

Scheduling tasks by reading time of execution from database instead of code

I am looking for a flow in ruby through which I can run a task daily on some particular times. I want to add a new task in some table, specify the time in some column and the task should be scheduled daily since the row has been added to the table.…
walt3rwhite
  • 73
  • 1
  • 12
1
vote
1 answer

Ice Cube Gem: Recurring Emails

Does anyone have an understanding of the ice_cube gem API? I'm trying to use it for sending reoccurring emails and I'm not sure if I understand if thats a valid use case for it or not. Does anyone have any examples? I can't find any anywhere. The…
zasman
  • 446
  • 1
  • 8
  • 28
1
2 3 4