seejohnrun/ice_cube — Issue #65: What is the best approach to identify the Schedule ?
Author: fluxsaas
Created: 2012-02-06 10:05:18+00:00
State: open

Hey,
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=>[{
:validations=>{
:day_of_month=>[10]},
:rule_type=>"IceCube::MonthlyRule",
:interval=>3
}],
:exrules=>[], :rdates=>[], :exdates=>[]
}

to set the specific form elements (dropdown, checkbox) i need to evaluate the specific validations. e.g. for

event.schedule.interval

i would expect

IceCube::MonthlyRule

i did not found any methods in the source, does somebody did sth. similar ? My approach would be to parse the hash and extract every role validation...

kind of a double post: http://stackoverflow.com/questions/9158421/identify-the-ice-cube-schedule