Moderator: Tata
svasti wrote: I hope somebody else could shed some light on API vs CGI mode here...
<?php echo calendar()?>tanavots wrote:Is it possible write code so, that if easter call fails, it will be disabled?
$easter = function_exists('easter_date') ? date("m/d/Y",easter_date($displayyear)) : FALSE;
$holidayarray = explode(";",$plugin_tx['calendar']['holydays']);
foreach ($holidayarray as $value) {
list($holiday_date,$holiday_name) = explode(",",$value);
// holidays depending on the easter date
if(strpos($holiday_date,'easter')!==FALSE && $easter!==FALSE){
http://de2.php.net/manual/en/function.easter-date.php wrote:The date of Easter Day was defined by the Council of Nicaea in AD325 as the Sunday after the first full moon which falls on or after the Spring Equinox. The Equinox is assumed to always fall on 21st March, so the calculation reduces to determining the date of the full moon and the date of the following Sunday.
if (!function_exists('easter_date')) {
function easter_date($year) {
$g = $year % 19 + 1;
$s = (11 * $g - 6) % 30;
$s = $s == 0 ? $s - 1 : ($s == 1 && $g >= 12 ? $s - 2 : $s);
$fm = mktime(0, 0, 0, 4, 19 - $s, $year);
$w = date('w', $fm);
$e = mktime(0, 0, 0, 4, 19 - $s + 7 - $w, $year);
return $e;
}
}
Users browsing this forum: No registered users and 1 guest