当前位置: 首页>>代码示例>>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;未经允许,请勿转载。