當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CMbDT::getEasterDate方法代碼示例

本文整理匯總了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;
 }
開發者ID:OpenXtrem,項目名稱:mediboard-test,代碼行數:65,代碼來源:CMbDate.class.php


注:本文中的CMbDT::getEasterDate方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。