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


PHP Zend_Date::subDayOfYear方法代碼示例

本文整理匯總了PHP中Zend_Date::subDayOfYear方法的典型用法代碼示例。如果您正苦於以下問題:PHP Zend_Date::subDayOfYear方法的具體用法?PHP Zend_Date::subDayOfYear怎麽用?PHP Zend_Date::subDayOfYear使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Zend_Date的用法示例。


在下文中一共展示了Zend_Date::subDayOfYear方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: testLoose


//.........這裏部分代碼省略.........
         // success
     }
     try {
         $date->addWeekday(null);
         $this->fail();
     } catch (Zend_Date_Exception $e) {
         // success
     }
     try {
         $date->subWeekday(null);
         $this->fail();
     } catch (Zend_Date_Exception $e) {
         // success
     }
     try {
         $date->compareWeekday(null);
         $this->fail();
     } catch (Zend_Date_Exception $e) {
         // success
     }
     try {
         $date->setDayOfYear(null);
         $this->fail();
     } catch (Zend_Date_Exception $e) {
         // success
     }
     try {
         $date->addDayOfYear(null);
         $this->fail();
     } catch (Zend_Date_Exception $e) {
         // success
     }
     try {
         $date->subDayOfYear(null);
         $this->fail();
     } catch (Zend_Date_Exception $e) {
         // success
     }
     try {
         $date->compareDayOfYear(null);
         $this->fail();
     } catch (Zend_Date_Exception $e) {
         // success
     }
     try {
         $date->setHour(null);
         $this->fail();
     } catch (Zend_Date_Exception $e) {
         // success
     }
     try {
         $date->addHour(null);
         $this->fail();
     } catch (Zend_Date_Exception $e) {
         // success
     }
     try {
         $date->subHour(null);
         $this->fail();
     } catch (Zend_Date_Exception $e) {
         // success
     }
     try {
         $date->compareHour(null);
         $this->fail();
     } catch (Zend_Date_Exception $e) {
開發者ID:jsnshrmn,項目名稱:Suma,代碼行數:67,代碼來源:DateTest.php

示例2: multiPaiementPackage

 private function multiPaiementPackage(Package $package)
 {
     $montant = 0;
     $montantPreleve = 0;
     $i = 1;
     $montantPanier = $this->montantTotal;
     /* @var PrestationPanier $prestationPanier */
     $aPaiement = array();
     $aPaiementImmediat = array();
     $dateValidePrecedent = null;
     $garantiePrecedente = null;
     $startPrestationPanier = $this->prestationsPanier;
     $prestationPanier = $startPrestationPanier[0];
     $debut = $prestationPanier->debut;
     //        foreach($this->prestationsPanier as $prestationPanier) {
     foreach ($package->garantieDemandee as $oGarantie) {
         if ($montantPanier == $montantPreleve) {
             break;
         }
         $debutSejour = new \Zend_Date($debut);
         $now = new \Zend_Date();
         $now->set(00, \Zend_Date::HOUR);
         $now->set(00, \Zend_Date::MINUTE);
         $now->set(00, \Zend_Date::SECOND);
         if ($oGarantie->condition == -1) {
             $condition = 0;
         } else {
             $condition = $oGarantie->condition;
         }
         $dateValide = $debutSejour->subDayOfYear($condition);
         if ($dateValide > $now) {
             if ($i == 1) {
                 $dateValidePrecedent = $dateValide;
                 $garantiePrecedente = $oGarantie;
                 $dateValide = $now;
             } elseif ($i == sizeof($package->garantieDemandee)) {
                 $dateValide = $debutSejour->subDayOfYear($garantiePrecedente->condition);
             } else {
                 $dateValide = $dateValidePrecedent;
                 $dateValidePrecedent = $dateValide;
                 $garantiePrecedente = $oGarantie;
             }
             $i++;
             if ($oGarantie->unite == "%") {
                 $montant = $montantPanier * ($oGarantie->valeur / 100) - $montantPreleve;
                 $montantPreleve += $montant;
             }
             if ($dateValide->toString("dd/MM/YYYY") == $now->toString("dd/MM/YYYY")) {
                 if (!isset($aPaiementImmediat[$dateValide->toString("dd/MM/YYYY")])) {
                     $aPaiementImmediat[$dateValide->toString("dd/MM/YYYY")] = $montant;
                 } else {
                     $aPaiementImmediat[$dateValide->toString("dd/MM/YYYY")] += $montant;
                 }
             } else {
                 if (!isset($aPaiement[$dateValide->toString("dd/MM/YYYY")])) {
                     $aPaiement[$dateValide->toString("dd/MM/YYYY")] = $montant;
                 } else {
                     $aPaiement[$dateValide->toString("dd/MM/YYYY")] += $montant;
                 }
             }
         }
     }
     //        }
     foreach ($aPaiementImmediat as $dateValide => $montant) {
         $paiement = new Paiement($montant, $dateValide);
         $this->addPaiement($paiement);
     }
     foreach ($aPaiement as $dateValide => $montant) {
         $paiement = new Paiement($montant, $dateValide);
         $this->addPaiement($paiement);
     }
     return $this->_paiements;
 }
開發者ID:sitecresa,項目名稱:toolkit,代碼行數:73,代碼來源:Panier.php


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