recurring_select icon indicating copy to clipboard operation
recurring_select copied to clipboard

Monthly results in daily occurrences

Open creativetags opened this issue 12 years ago • 3 comments

Run this in rails console:

params = {:interval => 1, :until => nil, :count => nil, :validations => { :day_of_month => [], :day_of_week=> {} }, :rule_type => "IceCube::MonthlyRule" }
rule = RecurringSelect.dirty_hash_to_rule(params)
s = IceCube::Schedule.new(now = Time.now)
s.add_recurrence_rule(rule)
s.occurrences(1.month.from_now)

I'm running Rails 3.2.14 , recurring_select 1.2.0 , ice_cube 0.11.0

I think it's due to not selecting a day of the month as this isn't required in the UI.

creativetags avatar Aug 24 '13 16:08 creativetags

I've looked into this - the underlying call to create a rule from the hash expects that if there are day_of_month validations to be present for them not to be empty, as it clobbers previous rules in the process - see here. I'm not sure where to fix this, any ideas authors?

fourseven avatar Sep 16 '13 09:09 fourseven

Bump. Also running into this problem. The UI allows the user to create a state the library doesn't handle (monthly schedule but with no day selected).

istan avatar Sep 30 '15 00:09 istan

That's a hard one, it's been two years! The answer is probably one of my commits here - https://github.com/mhchen/recurring_select/compare/master...marcmchardy:master

fourseven avatar Sep 30 '15 00:09 fourseven