So I'm trying to add the Philippines holidays to the forum Calendar but I'm having some problems figuring out the code. Fixed holidays are no problem, I can do this no problem. The movable holidays though......I'm not seeing the pattern/logic in the code. Fixed holidays look like this: PHP: if ($m == 1 && $d == 1) // jan 1 return "New Year's Day";if ($m == 2 && $d == 14) // feb 14 return "Valentine's Day";if ($m == 3 && $d == 17) // mar 17 return "St. Patrick's Day"; This is pretty easy for someone who doesn't understand a bit of php. Movable holidays look like this: PHP: if ($m == 1 && match_day($y, $m, $d, 1, 3)) // 3rd mon in jan return "Martin Luther King Day";if ($m == 2 && match_day($y, $m, $d, 1, 3)) // 3rd mon in feb return "President's Day";if ($m == 5 && match_day($y, $m, $d, 0, 2)) // 2nd sun in may return "Mother's Day";if ($m == 11 && match_day($y, $m, $d, 5, 4)) // 4th fri in nov return "Black Friday"; To start off with, I'm absolutely horrible with anything involving a calendar. I have no idea what months have how many days and if months are written in numeric form I have to say them in my head to figure out the ones in the middle.....so, this crap is just not making any d*mn sense to me. I am getting lost on the last set of digits in these strings of code. After the $d you have two numbers the first one I am assuming is the day, with 0=Sunday, 1=Monday and so on. The second number is maybe how many of the days it is into the month? Ah....ok. Worked it out. Painfully obvious now. I will probably forget this so I will just go ahead and post it for future reference.
So are you saying you do can not calculate which days of the month are going to be hell with you GF? I used to try then I realized.... almost everyday was hell... got a new GF.
I have added most of the national holidays in the Philippines. I have excluded several religious holidays because of the complexity of the days they fall on (it's nothing against Easter or Ramadan, I just have no earthly clue how to make it show for holidays that revolve around a equinox/lunar cycle....nor am I motivated enough to learn how to). So far I have added the "regular holidays" from this wikipedia page. If anyone knows of additional holidays/non-working days please share the date (or day of the month) and I will get it added to the calendar. Note that US holidays are on the calendar because they were already there. I have added a "U.S." to these holiday's names so people will know that it is not a Philippine holiday. I have also added the Tagalog translation to the Philippine holidays to further differentiate. If I can get a list of local holidays and Fiestas I will add them as well.