• Welcome to XF2 Addons

    You can purchase a Premium membership for only $35 per year, and this gives you access to download any or ALL of the over 400 add-ons developed for Xenforo 2.x. In addition, Premium members will get technical support. Once the Premium membership has expired you can continue to use the installed addons on your forum as long as you like.

How to change or add Calendar holidays?

Andy

Administrator
Staff member
1) In the Options page set the Holiday path.

2) Copy this file to your /misc/ folder.

1512940401315.png


3) Edit the /misc/Holiday.php file as needed.
 

webbouk

New Member
If anyone wants the 2022 UK holidays, copy and paste the attached code into your holiday.php file overwriting last year's contents...
 

Attachments

  • holiday.txt
    2.7 KB · Views: 90

phtvs

New Member
If anyone wants the 2022 Dutch holidays, copy and paste the attached code into your holiday.php file
 

Attachments

  • Holiday.php
    3.1 KB · Views: 25

mph

New Member
Here is an example for German Holidays. I use it with Calendar 5.5. You can copy the code of the attachment to your Holiday.php.

Some Holidays depends on the easter sunday. This Holidays are calculated by the function easter_date. Therefore there is no need for a special Holiday.php for each calendar year. Code example (not the complete Holiday.php):

Code:
    $tage = 60 * 60 * 24;
       $ostern = easter_date($y);  // Ostersonntag ermitteln
   
       $mkarfreitag = date("n", $ostern - 2 * $tage);
       $dkarfreitag = date("j", $ostern - 2 * $tage); 

    if ($m == $mkarfreitag && $d == $dkarfreitag) // Karfreitag
    return "Karfreitag";

       $mosonntag = date("n", $ostern);
       $dosonntag = date("j", $ostern);

    if ($m == $mosonntag && $d == $dosonntag) // Ostersonntag
    return "Ostersonntag";

The php function easter_date causes a warning for time before 1970 and (on systems with 32 bit) after 2037. Because you can see only the actual year and the year before and after I think there is no need for a special handling of the function limit. And in most cases we have 64 bit servers.
 

Attachments

  • HolidaysD.php
    3.1 KB · Views: 5
Top