当前位置: 首页>>代码示例>>PHP>>正文


PHP Zend_Date::isLater方法代码示例

本文整理汇总了PHP中Zend_Date::isLater方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Date::isLater方法的具体用法?PHP Zend_Date::isLater怎么用?PHP Zend_Date::isLater使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Zend_Date的用法示例。


在下文中一共展示了Zend_Date::isLater方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: _saveContract

 /**
  * 
  * @param array $data
  * @return int
  * @throws Exception
  */
 protected function _saveContract($data)
 {
     $dateStart = new Zend_Date($data['date_start']);
     $dateFinish = new Zend_Date($data['date_finish']);
     // Check if the initial date is later than finish date
     if ($dateStart->isLater($dateFinish)) {
         $message = 'Data loron keta liu data remata.';
         $this->_message->addMessage($message);
         $this->addFieldError('date_start')->addFieldError('date_finish');
         throw new Exception($message);
     }
     // If there is no contract yet
     if (empty($data['fk_id_fefop_contract'])) {
         $dataContract = array('module' => Fefop_Model_Mapper_Module::DRH, 'district' => $data['fk_id_adddistrict']);
         $mapperFefopContract = new Fefop_Model_Mapper_Contract();
         $data['fk_id_fefop_contract'] = $mapperFefopContract->save($dataContract);
     }
     $data['date_start'] = $dateStart->toString('yyyy-MM-dd');
     $data['date_finish'] = $dateFinish->toString('yyyy-MM-dd');
     $dataForm = $data;
     $this->_data = $data;
     // Save the contract
     $dataForm['id_drh_contract'] = parent::_simpleSave($this->_dbTable, false);
     // Save budget category
     $this->_saveExpenses($dataForm);
     if (empty($data['id_drh_contract'])) {
         $history = 'REJISTU KONTRAKTU DRH: %s';
     } else {
         $history = 'ATUALIZA KONTRAKTU DRH: %s';
     }
     $history = sprintf($history, $dataForm['id_drh_contract']);
     $this->_sysAudit($history);
     return $dataForm['id_drh_contract'];
 }
开发者ID:fredcido,项目名称:simuweb,代码行数:40,代码来源:DRHContract.php

示例2: testSetWhenDefaultsToCurrentTime

 public function testSetWhenDefaultsToCurrentTime()
 {
     $entry = new Zend_Feed_Writer_Deleted();
     $entry->setWhen();
     $dateNow = new Zend_Date();
     $this->assertTrue($dateNow->isLater($entry->getWhen()) || $dateNow->equals($entry->getWhen()));
 }
开发者ID:jsnshrmn,项目名称:Suma,代码行数:7,代码来源:DeletedTest.php

示例3: isValid

 public function isValid($value)
 {
     $front = Zend_Controller_Front::getInstance()->getRequest();
     $action = $front->action;
     if ($action == "edit-evento") {
         return true;
     }
     if (!isset($value) or empty($value)) {
         return false;
     }
     //date_default_timezone_set( 'America/Sao_Paulo' );
     //  Zend_Registry::get('logger')->log("valor=", Zend_Log::INFO);
     // Zend_Registry::get('logger')->log($value, Zend_Log::INFO);
     $date = new Zend_Date();
     $data = new Zend_Date($date->toString('dd/MM/YYYY'));
     $data2 = new Zend_Date($value);
     $comparacao = $data->isLater($data2);
     $comparacao2 = $data->isEarlier($data2);
     $comparacao3 = $data->equals($data2);
     // Zend_Registry::get('logger')->log($comparacao, Zend_Log::INFO);
     //  Zend_Registry::get('logger')->log($comparacao2, Zend_Log::INFO);
     // Zend_Registry::get('logger')->log($comparacao3, Zend_Log::INFO);
     if ($comparacao3 || $comparacao2) {
         Zend_Registry::get('logger')->log("data igual ou maior", Zend_Log::INFO);
     } else {
         $this->_setValue($value);
         //	Zend_Registry::get('logger')->log("data menor", Zend_Log::INFO);
         $this->_error(self::INVALID);
         return false;
     }
     // $comparacao= $data->compare($date2);
     // Zend_Registry::get('logger')->log($comparacao, Zend_Log::INFO);
     //  Zend_Registry::get('logger')->log($comparacao2, Zend_Log::INFO);
     return true;
 }
开发者ID:andrelsguerra,项目名称:pequiambiental,代码行数:35,代码来源:Data.php

示例4: checkDateConstraint

 public static function checkDateConstraint($dateTime, $limit)
 {
     $dateStr = $dateTime->format('Y-m-d H:i:s');
     $date = new Zend_Date($dateStr, 'yyyy-MM-dd HH:mm:ss');
     $now = new Zend_Date();
     $date->add($limit, Zend_Date::DAY);
     return $date->isLater($now);
 }
开发者ID:revoleers,项目名称:rewardimizer-server,代码行数:8,代码来源:Date.php

示例5: hasExpired

 /** Has the token expired?
  *
  * @param string $access_token_expiry
  */
 private function hasExpired($access_token_expiry)
 {
     $now = new Zend_Date(NULL, 'yyyy-MM-dd HH:mm:ss');
     $tokenDate = new Zend_Date($access_token_expiry, 'YYYY-MM-dd HH:mm:ss');
     $difference = $tokenDate->isLater($now);
     if ($now > $tokenDate) {
         return true;
     } else {
         return false;
     }
 }
开发者ID:lesleyauk,项目名称:findsorguk,代码行数:15,代码来源:Oauth.php

示例6: isValid

 public function isValid($data)
 {
     $valid = parent::isValid($data);
     $date1 = new Zend_Date($data['valid_since']);
     $date2 = new Zend_Date($data['valid_until']);
     if ($date1->isLater($date2)) {
         $this->addError('Nieprawidłowy przedział dat.');
         $valid = false;
     }
     return $valid;
 }
开发者ID:knatorski,项目名称:SMS,代码行数:11,代码来源:Add.php

示例7: isValid

 public function isValid($value, $context = null)
 {
     $value = (string) $value;
     $this->_setValue($value);
     $endDate = new Zend_Date($value);
     if (isset($context[$this->_field]) && $endDate->isLater($context[$this->_field])) {
         return true;
     } else {
         $this->_error();
         return false;
     }
 }
开发者ID:br00k,项目名称:tnc-web,代码行数:12,代码来源:DateIsLater.php

示例8: isFeedbackOpen

 /**
  * Is feedback open? Feedback is open when the feedback codes are sent and the
  * feedback closing date has not passed
  *
  * @return	mixed	boolean on false or Zend_Date on true
  */
 public function isFeedbackOpen()
 {
     $eventlogModel = new Core_Model_Eventlog();
     if (false === ($feedbackSent = $eventlogModel->getTimestampByType('Core_FeedbackController::mailallAction'))) {
         return false;
     }
     $date = new Zend_Date();
     if ($date->isLater($feedbackSent) && $date->isEarlier($this->_conference['feedback_end'], Zend_Date::ISO_8601)) {
         return $date;
     }
     return false;
 }
开发者ID:br00k,项目名称:tnc-web,代码行数:18,代码来源:ConferenceInfo.php

示例9: save

 /**
  * 
  * @return int|bool
  */
 public function save()
 {
     $dbAdapter = Zend_Db_Table_Abstract::getDefaultAdapter();
     $dbAdapter->beginTransaction();
     try {
         $dateStart = new Zend_Date($this->_data['date_start']);
         $dateFinish = new Zend_Date($this->_data['date_finish']);
         $mapperRule = new Fefop_Model_Mapper_Rule();
         $mapperRule->validate($this->_message, $this->_data, Fefop_Model_Mapper_Expense::CONFIG_PFPCI_RI);
         // Check if the initial date is later than finish date
         if ($dateStart->isLater($dateFinish)) {
             $this->_message->addMessage('Data loron keta liu data remata.');
             $this->addFieldError('date_start')->addFieldError('date_finish');
             return false;
         }
         // If there is no contract yet
         if (empty($this->_data['fk_id_fefop_contract'])) {
             $dataContract = array('module' => Fefop_Model_Mapper_Module::RI, 'district' => $this->_data['fk_id_adddistrict']);
             $mapperFefopContract = new Fefop_Model_Mapper_Contract();
             $this->_data['fk_id_fefop_contract'] = $mapperFefopContract->save($dataContract);
         }
         $this->_data['amount'] = App_General_String::toFloat($this->_data['amount']);
         $this->_data['date_start'] = $dateStart->toString('yyyy-MM-dd');
         $this->_data['date_finish'] = $dateFinish->toString('yyyy-MM-dd');
         $dataForm = $this->_data;
         // Save the contract
         $dataForm['id_ri_contract'] = parent::_simpleSave();
         // Save budget category
         $this->_saveExpenses($dataForm);
         if (empty($this->_data['id_ri_contract'])) {
             $history = 'REJISTU KONTRAKTU RI: %s';
         } else {
             $history = 'ATUALIZA KONTRAKTU RI: %s';
         }
         $history = sprintf($history, $dataForm['id_ri_contract']);
         $this->_sysAudit($history);
         if ($this->_data['amount'] > self::LIMIT_AMOUNT) {
             $this->_sendWarningAmount($dataForm['id_ri_contract']);
         }
         $diff = $dateFinish->sub($dateStart);
         $measure = new Zend_Measure_Time($diff->toValue(), Zend_Measure_Time::SECOND);
         $diffMonth = preg_replace('/[^0-9.]/i', '', $measure->convertTo(Zend_Measure_Time::MONTH, 0));
         if ((double) $diffMonth > self::MOUNTH_LIMIT) {
             $this->_sendWarningDuration($dataForm['id_ri_contract']);
         }
         $dbAdapter->commit();
         return $dataForm['id_ri_contract'];
     } catch (Exception $e) {
         $dbAdapter->rollBack();
         $this->_message->addMessage($this->_config->messages->error, App_Message::ERROR);
         return false;
     }
 }
开发者ID:fredcido,项目名称:simuweb,代码行数:57,代码来源:RIContract.php

示例10: _getDate

 protected function _getDate($timeAmount, Zend_Date $date)
 {
     $nowDate = new Zend_Date();
     $dateWithTimeAmount = $date->addHour($timeAmount);
     if ($timeAmount == 0) {
         $date = $date->addMinute(1);
     } elseif ($timeAmount < 0 && $nowDate->isLater($dateWithTimeAmount)) {
         $date = $nowDate->addMinute(1);
     } else {
         $date = $dateWithTimeAmount;
     }
     return $date;
 }
开发者ID:xiaoguizhidao,项目名称:mydigibits,代码行数:13,代码来源:Alert.php

示例11: isDateBetween

 public function isDateBetween($target, $from, $to)
 {
     if (is_null($from) && is_null($to)) {
         return true;
     }
     $target = new Zend_Date($target);
     $from = new Zend_Date($from);
     $to = new Zend_Date($to);
     if ($target->isEarlier($to) && $target->isLater($from)) {
         return true;
     }
     return false;
 }
开发者ID:eadsimone,项目名称:moduleforben,代码行数:13,代码来源:Data.php

示例12: assert

 /**
  * This assertion should receive the actual Submission objects.
  *
  * @param Zend_Acl $acl
  * @param Zend_Acl_Role_Interface $user
  * @param Zend_Acl_Resource_Interface $model
  * @param $privilege
  * @return bool
  */
 public function assert(Zend_Acl $acl, Zend_Acl_Role_Interface $user = null, Zend_Acl_Resource_Interface $model = null, $privilege = null)
 {
     $conference = Zend_Registry::get('conference');
     if (!isset($conference['review_visible'])) {
         return true;
     }
     $now = new Zend_Date();
     // perform check
     if ($now->isLater($conference['review_visible'])) {
         return true;
     }
     return false;
 }
开发者ID:GEANT,项目名称:CORE,代码行数:22,代码来源:UserCanListReviewsAssertion.php

示例13: isValid

 public function isValid($data)
 {
     $isValid = parent::isValid($data);
     if (!empty($data['date_for']) && !empty($data['date_to'])) {
         $date = new Zend_Date();
         $date2 = clone $date;
         $date->setDate($data['date_for'], 'YYYY-MM-dd')->getTimestamp();
         $date2->setDate($data['date_to'], 'YYYY-MM-dd')->getTimestamp();
         if ($date->isLater($date2)) {
             $isValid = false;
             $this->getElement('date_to')->addError("Data do nie może być wcześniejsza niż data od");
         }
     }
     return $isValid;
 }
开发者ID:knatorski,项目名称:SMS,代码行数:15,代码来源:Search.php

示例14: getProductLabels

 public function getProductLabels($product)
 {
     $html = '';
     if (Mage::getStoreConfig('meigee_indigo_general/productlabels/labelnew')) {
         $from = $product->getNewsFromDate();
         $to = new Zend_Date($product->getNewsToDate());
         $now = new Zend_Date(Mage::getModel('core/date')->timestamp(time()));
         if (isset($from) && $to->isLater($now)) {
             $html .= '<span class="label-new">' . $this->__('New') . '</span>';
         }
     }
     if (Mage::getStoreConfig('meigee_indigo_general/productlabels/labelonsale') and $this->isOnSale($product)) {
         $html .= '<span class="label-sale">' . $this->__('Sale') . '</span>';
     }
     return $html;
 }
开发者ID:drunkvegas,项目名称:done,代码行数:16,代码来源:Data.php

示例15: save

 /**
  * 
  * @return int|bool
  */
 public function save()
 {
     $dbAdapter = Zend_Db_Table_Abstract::getDefaultAdapter();
     $dbAdapter->beginTransaction();
     try {
         $dateStart = new Zend_Date($this->_data['date_start']);
         $dateFinish = new Zend_Date($this->_data['date_finish']);
         $mapperExpense = new Fefop_Model_Mapper_Expense();
         $item = $mapperExpense->getModuleToItem($this->_data['fk_id_fefop_modules']);
         $mapperRule = new Fefop_Model_Mapper_Rule();
         $mapperRule->validate($this->_message, $this->_data, $item);
         // Check if the initial date is later than finish date
         if ($dateStart->isLater($dateFinish)) {
             $this->_message->addMessage('Data loron keta liu data remata.');
             $this->addFieldError('date_start')->addFieldError('date_finish');
             return false;
         }
         // If there is no contract yet
         if (empty($this->_data['fk_id_fefop_contract'])) {
             $dataContract = array('module' => $this->_data['fk_id_fefop_modules'], 'district' => $this->_data['fk_id_adddistrict']);
             $mapperFefopContract = new Fefop_Model_Mapper_Contract();
             $this->_data['fk_id_fefop_contract'] = $mapperFefopContract->save($dataContract);
         }
         $this->_data['amount'] = App_General_String::toFloat($this->_data['amount']);
         $this->_data['date_start'] = $dateStart->toString('yyyy-MM-dd');
         $this->_data['date_finish'] = $dateFinish->toString('yyyy-MM-dd');
         $dataForm = $this->_data;
         // Save the contract
         $dataForm['id_per_contract'] = parent::_simpleSave();
         $dataForm['fk_id_per_contract'] = $dataForm['id_per_contract'];
         // Save budget category
         $this->_saveExpenses($dataForm);
         if (empty($this->_data['id_per_contract'])) {
             $history = 'REJISTU KONTRAKTU PER: %s';
         } else {
             $history = 'ATUALIZA KONTRAKTU PER: %s';
         }
         $history = sprintf($history, $dataForm['id_per_contract']);
         $this->_sysAudit($history);
         $dbAdapter->commit();
         return $dataForm['id_per_contract'];
     } catch (Exception $e) {
         $dbAdapter->rollBack();
         $this->_message->addMessage($this->_config->messages->error, App_Message::ERROR);
         return false;
     }
 }
开发者ID:fredcido,项目名称:simuweb,代码行数:51,代码来源:PERContract.php


注:本文中的Zend_Date::isLater方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。