Hello,

Would it be possible to add functionality that would allow admins to designate specific dates that should be excluded from the calendar? For example, let's say that Mondays are always included, but Christmas falls on a Monday this year. I'd want to be able to exclude 12/25/14 from the calendar.

Comments

jonhattan’s picture

This is part of the "future plans".

Define availability exceptions based on inclusion/exclusion of day-month. That is, define concrete days to be an exception to the week pattern.

hockey2112’s picture

Issue summary: View changes
lahode’s picture

StatusFileSize
new3.92 KB

Hi there,

Please find a patch that will do the work. I added a textarea in the work calendar entity, where your can put the dates separate by a break line (eg.
2015-01-18
2015-02-15
2015-02-21

It will exclude those day in the calendar (tested with date restrictions)

I know it can be improved (I didn't do any hook_update_N for instance, so at this point if you add the patch, you need to reinstall the module).

Anyway, hope it might help

Cheers

jonhattan’s picture

Component: Miscellaneous » Code

@lahode thanks for your effort, but I want to implement this in other direction. The key points are:

* Find a way to store month/day to the database. That is, exclude year, since it must work for any year.
* #2071337: Leverage weekdays module and use weekdays_days_in_date_range() to actually include/exclude dates.

Denial’s picture

@lahode thanks very much, exactly what I needed, works as intended.

Abelito’s picture

Version: 7.x-1.x-dev » 7.x-2.x-dev

@Iahode Thanks!
This patch works with the latest dev version when applied manually.

@jonhattan You can use this for either include or exclude if you use the Date Restriction module. That setting is found when editing the field type.

lazzyvn’s picture

StatusFileSize
new37.12 KB
new17.42 KB
new5.85 KB

Hello,
I have new patch you can add yours holidays, your vacations here some demo
setup
popup

lazzyvn’s picture

StatusFileSize
new8.78 KB

Update #7 for alter day