ice-cube

ice_cube and recurring_select gems and occurrences

偶尔善良 提交于 2019-12-09 16:41:19
问题 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) write_attribute(:schedule, RecurringSelect.dirty_hash_to_rule(new_schedule).to_yaml) end def converted_schedule Schedule.from_yaml(self.schedule, :start_date_override => self.start_date) end Looking at the schedule column in psql, it appears to be storing the

Opening hours in ice_cube

回眸只為那壹抹淺笑 提交于 2019-12-06 08:33:01
问题 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 Rule.daily.day(:wednesday) schedule.add_recurrence_rule Rule.daily.day(:thursday) (...) schedule.occurring_at?(Time.now) 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? 回答1:

Opening hours in ice_cube

ぐ巨炮叔叔 提交于 2019-12-04 13:33:00
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 Rule.daily.day(:wednesday) schedule.add_recurrence_rule Rule.daily.day(:thursday) (...) schedule.occurring_at?(Time.now) 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? Just got email from an Ice_Cube author answering my question. Might be usefull: Unfortunately we strive to

ice_cube and recurring_select gems and occurrences

元气小坏坏 提交于 2019-12-04 04:35:27
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) write_attribute(:schedule, RecurringSelect.dirty_hash_to_rule(new_schedule).to_yaml) end def converted_schedule Schedule.from_yaml(self.schedule, :start_date_override => self.start_date) end Looking at the schedule column in psql, it appears to be storing the schedule correctly. Here's my form: .control-group = f.label 'Date', :class => 'control-label' .controls

Single occurrence event with ice_cube gem using start_time and end_time

孤街浪徒 提交于 2019-12-03 15:04:31
问题 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 reservation" rails application. The first scenario would be creating a basic schedule with a specific start_time and end_time - occurring only once. IceCube can do this, correct? The schedule would begin on the start_time and end at the end_time . I

Single occurrence event with ice_cube gem using start_time and end_time

。_饼干妹妹 提交于 2019-12-03 03:59:20
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 reservation" rails application. The first scenario would be creating a basic schedule with a specific start_time and end_time - occurring only once. IceCube can do this, correct? The schedule would begin on the start_time and end at the end_time . I would expect to be able to check if dates or times occurs_on? this schedule to determine if a room

gem ice_cube for reccurence events

感情迁移 提交于 2019-11-30 15:35:08
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 model: class Event < ActiveRecord::Base #require 'ice_cube' include IceCube belongs_to :user validates :title, :presence => true, :length => { :minimum => 5 } validates :shedule, :presence => true def self.events_and_repeats(date) @events = Event.where(shedule:date.beginning_of_month..date.end_of_month) # Here I need to figure out what is events

gem ice_cube for reccurence events

岁酱吖の 提交于 2019-11-29 21:04:19
问题 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 model: class Event < ActiveRecord::Base #require 'ice_cube' include IceCube belongs_to :user validates :title, :presence => true, :length => { :minimum => 5 } validates :shedule, :presence => true def self.events_and_repeats(date) @events = Event