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


PHP Zend_Locale_Format::checkDateFormat方法代碼示例

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


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

示例1: checkDate

 public static function checkDate($date, $format = '')
 {
     if (empty($format)) {
         if (Zend_Registry::isRegistered('date_format')) {
             $format = Zend_Registry::get('date_format');
         } else {
             $format = self::MYSQL_DATE_FORMAT;
         }
     }
     return Zend_Locale_Format::checkDateFormat($date, array('date_format' => $format));
 }
開發者ID:gatorv,項目名稱:gecko_fw1,代碼行數:11,代碼來源:Date.php

示例2: filter

 /**
  * Defined by Zend_Filter_Interface
  *
  * Normalizes the given input
  *
  * @param  string $value Value to normalized
  * @return string|array The normalized value
  */
 public function filter($value)
 {
     if (Zend_Locale_Format::isNumber($value, $this->_options)) {
         return Zend_Locale_Format::getNumber($value, $this->_options);
     } else {
         if ($this->_options['date_format'] === null && strpos($value, ':') !== false) {
             // Special case, no date format specified, detect time input
             return Zend_Locale_Format::getTime($value, $this->_options);
         } else {
             if (Zend_Locale_Format::checkDateFormat($value, $this->_options)) {
                 // Detect date or time input
                 return Zend_Locale_Format::getDate($value, $this->_options);
             }
         }
     }
     return $value;
 }
開發者ID:NerdGZ,項目名稱:icingaweb2,代碼行數:25,代碼來源:LocalizedToNormalized.php

示例3: testCheckTime

 /**
  * test checkDateFormat -> time
  * expected boolean
  */
 public function testCheckTime()
 {
     $this->assertTrue( Zend_Locale_Format::checkDateFormat('13:10:55',    array('date_format' => 'HH:mm:ss', 'locale' => 'de_AT')));
     $this->assertTrue( Zend_Locale_Format::checkDateFormat('11:10:55 am', array('date_format' => 'HH:mm:ss', 'locale' => 'ar_EG')));
     $this->assertFalse(Zend_Locale_Format::checkDateFormat('notime'));
     $this->assertFalse(Zend_Locale_Format::checkDateFormat('13:10',       array('date_format' => 'HH:mm:ss', 'locale' => 'de_AT')));
     $this->assertFalse(Zend_Locale_Format::checkDateFormat('13',          array('date_format' => 'HH:mm',    'locale' => 'de_AT')));
     $this->assertFalse(Zend_Locale_Format::checkDateFormat('00:13',       array('date_format' => 'ss:mm:HH', 'locale' => 'de_AT')));
 }
開發者ID:jorgenils,項目名稱:zend-framework,代碼行數:13,代碼來源:FormatTest.php

示例4: testCheckDateFormatDoesNotEmitNoticeWhenNoOptionsAreNotProvided

 /**
  * @group ZF-11837
  */
 public function testCheckDateFormatDoesNotEmitNoticeWhenNoOptionsAreNotProvided()
 {
     try {
         setlocale(LC_ALL, 'en_US');
         // test setup
         Zend_Locale_Format::setOptions(array('date_format' => 'yyyy-MM-dd'));
         $this->assertTrue(Zend_Locale_Format::checkDateFormat('2011-10-21', array()));
     } catch (PHPUnit_Framework_Error_Notice $ex) {
         $this->fail('Zend_Locale_Format::checkDateFormat emitted unexpected E_NOTICE');
     }
 }
開發者ID:ThorstenSuckow,項目名稱:conjoon,代碼行數:14,代碼來源:FormatTest.php

示例5: testCheckTime

 /**
  * test checkDateFormat -> time
  * expected boolean
  */
 public function testCheckTime()
 {
     $this->assertTrue(Zend_Locale_Format::checkDateFormat('13:10:55', array('date_format' => 'HH:mm:ss', 'locale' => 'de_AT')), "true expected");
     $this->assertTrue(Zend_Locale_Format::checkDateFormat('11:10:55 am', array('date_format' => 'HH:mm:ss', 'locale' => 'ar_EG')), "true expected");
     $this->assertFalse(Zend_Locale_Format::checkDateFormat('notime'), "false expected");
 }
開發者ID:jorgenils,項目名稱:zend-framework,代碼行數:10,代碼來源:FormatTest.php


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