本文整理汇总了PHP中CMbDT::getEasterDate方法的典型用法代码示例。如果您正苦于以下问题:PHP CMbDT::getEasterDate方法的具体用法?PHP CMbDT::getEasterDate怎么用?PHP CMbDT::getEasterDate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CMbDT
的用法示例。
在下文中一共展示了CMbDT::getEasterDate方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getCpHolidays
/**
* Get the holidays by region
*
* @param string $date date to check
*
* @param null|CGroups $group group, null = current
*
* @return array
*/
static function getCpHolidays($date, $group = null)
{
$subdivisionHoliday = array();
$pays = CAppUI::conf("ref_pays");
//no group, load current
if (!$group) {
$group = CGroups::loadCurrent();
}
//no CP, abord
if (!$group->cp) {
return $subdivisionHoliday;
}
$year = CMbDT::transform("+0 DAY", $date, "%Y");
$paques = CMbDT::getEasterDate($date);
switch ($pays) {
// France
case '1':
return $subdivisionHoliday;
break;
// Switzerland
// Switzerland
case '2':
$firstSundaySeptember = CMbDT::transform("next sunday", $year . "-09-00", "%Y-%m-%d");
$thirdSundaySeptember = CMbDT::transform("+2 WEEK", $firstSundaySeptember, "%Y-%m-%d");
$canton = substr($group->cp, 0, 2);
switch ($canton) {
// Vaud
case '10':
$subdivisionHoliday["{$year}-01-02"] = "Saint-Berchtold";
$subdivisionHoliday[CMbDT::transform("last friday", $paques, "%Y-%m-%d")] = "vendredi saint";
$subdivisionHoliday[CMbDT::transform("+1 DAY", $paques, "%Y-%m-%d")] = "lundi de paques";
$subdivisionHoliday[CMbDT::transform("+39 DAY", $paques, "%Y-%m-%d")] = "Ascension";
$subdivisionHoliday[CMbDT::transform("+50 DAY", $paques, "%Y-%m-%d")] = "lundi de pantecote";
$subdivisionHoliday[CMbDT::transform("+1 DAY", $thirdSundaySeptember, "%Y-%m-%d")] = "Lundi du Jeûne fédéral";
break;
// Genève
// Genève
case '12':
$subdivisionHoliday[CMbDT::transform("next thursday", $firstSundaySeptember, "%Y-%m-%d")] = "Jeûne Genevois";
$subdivisionHoliday[CMbDT::transform("last friday", $paques, "%Y-%m-%d")] = "vendredi saint";
$subdivisionHoliday[CMbDT::transform("+1 DAY", $paques, "%Y-%m-%d")] = "lundi de paques";
$subdivisionHoliday[CMbDT::transform("+39 DAY", $paques, "%Y-%m-%d")] = "Ascension";
$subdivisionHoliday[CMbDT::transform("+50 DAY", $paques, "%Y-%m-%d")] = "lundi de pantecote";
$subdivisionHoliday["{$year}-12-31"] = "fete du travail";
break;
default:
return $subdivisionHoliday;
break;
}
break;
default:
return $subdivisionHoliday;
break;
}
return $subdivisionHoliday;
}