tandusrl / acts_as_bookable

A reservation plugin for Rails applications that allows resources to be bookable.
MIT License
140 stars 104 forks source link

Allow schedule to have specific, human-defined dates #21

Closed edwardmp closed 7 years ago

edwardmp commented 7 years ago

Hi,

Thanks for developing this, it looks great! I have a very specific use case and I wondered whether it is currently easy/recommended to do something like this:

I have two models (let's call them Worker and Company). The former acts as bookable and the latter as booker. Worker's hand us their availability in the coming time period (e.g. specific days). It doesn't seem to be possible right now to create a schedule of fixed dates, or am I missing something?

colemerrick commented 7 years ago

This question is really about IceCube Schedule. Please check it's documentation.

Chosko commented 7 years ago

As @colemerrick wrote, this is partially a question about IceCube::Schedule. But you need the right bookable configuration either...

You should be able to do it configuring the Worker with acts_as_bookable time_type: :fixed and adding a rule like worker.schedule.add_recurrence_rule IceCube::Rule.monthly.day_of_month([1,3,8])

In this example the worker is available every month, the first the third and the eighth day of the month.

Let me know if this works for you...

edwardmp commented 7 years ago

@Chosko thanks, but doesn't that imply that it's the same for each month? My real schedule is based on people's availability and thus doesn't follow any rules in particular.

Chosko commented 7 years ago

In fact, you can even add rules or exception rules for fixed dates. Please Check out the IceCube documentation..