Holiday schedule handling

I was just wondering if there was a module that handles common holidays (like thanksgiving and christmas) or if it would be necessary to manually program time groups that deal with them every time they come up.

Just use time groups.

Here’s a list suitable in The United States:

Independence Day: ||4|jul
Christmas: ||25|dec
NewYear: ||1|jan
MartinLutherKing: *|mon|15-21|jan
Valentines: ||14|feb
StPatDay ||17|mar
Halloween ||31|oct
Thanksgiving *|thu|22-28|nov
MemorialDay *|mon|25-31|may
LaborDay *|mon|1-7|sep
Pres/WashBday *|mon|15-21|feb
MothersDay *|sun|8-14|may
FathersDay *|sun|15-21|jun

This was from a similar discussion in the bug tracker.

http://www.freepbx.org/v2/ticket/1687

Excellent, thanks a bunch! One final question - what’s the best way to make use of them? Do I just have one time condition that starts with New Years and strings them all together until the very end with Christmas, and if none of the conditions are met it goes to my normal office IVR menus?

Yes, you can make one time condition with all of the dates. We’ve got one called “US Holidays” that contains all of the holidays that our office is closed. System plays a “we’re closed for the holiday” announcement. We have others as well, and through judicious linking of the Time Conditions, we know what when we’re closed (whether for holidays, birthdays, or conferences), our office phone says we’re closed.

Has anyone figured out how to deal with Good Friday and/or Easter Monday with this system?

Unfortunately, since the time conditions are based on Julian calendar dates, it’s almost impossible to deal with the modified Lunar math involved in calculating Good Friday/Easter.

“It’s the first Sunday after the first full moon after the spring equinox.” Since the full moon (lunar calendar) does not follow the sidereal (Julian) calendar, it is essentially impossible to do programmatically within FreePBX.

You’re better off making an Easter Time Condition that lists the next 10 years worth of Easters, and just add it. Then place a reminder in your favorite tickler system to update it in 2021.

(Side note: Interesting article on Easter and how the math works is at http://www.astropotamus.com/archives/281)

I know this is a really old thread but I figured that there are probably still people wanting to do this. Since FreePBX is basically a web server GUI, it seems like this could be done with the PHP function at the following location.

http://www.php.net/manual/en/function.easter-date.php

Maybe someone out there can tell us what DB/Table such a script would have to update and that script could be run via cron.

http://www.php.net/manual/en/function.easter-date.php