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


PHP Converter::formatDate方法代码示例

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


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

示例1: getViewValue

 /**
  * Get view value
  *
  * @param array $field Field
  *
  * @return mixed
  */
 protected function getViewValue(array $field)
 {
     $value = parent::getViewValue($field);
     if (is_scalar($value)) {
         $value = \XLite\Core\Converter::formatDate($value);
     }
     return $value;
 }
开发者ID:kirkbauer2,项目名称:kirkxc,代码行数:15,代码来源:Date.php

示例2: getDefaultOptions

 /**
  * Get default options
  *
  * @return array
  */
 protected function getDefaultOptions()
 {
     $time = \XLite\Core\Converter::time();
     $allowedDateFormats = \XLite\Core\Converter::getAvailableDateFormats();
     $options = array();
     foreach ($allowedDateFormats as $phpFormat => $formats) {
         $options[$phpFormat] = \XLite\Core\Converter::formatDate($time, $phpFormat);
     }
     return $options;
 }
开发者ID:kirkbauer2,项目名称:kirkxc,代码行数:15,代码来源:DateFormat.php

示例3: getExpiredKeys

 /**
  * Get list of expired keys
  *
  * @return array
  */
 public function getExpiredKeys()
 {
     if (!isset($this->expiredKeys)) {
         $this->expiredKeys = array();
         $entries = \XLite\Upgrade\Cell::getInstance()->getEntries();
         $keys = \XLite\Core\Database::getRepo('XLite\\Model\\ModuleKey')->findAll();
         $commonURLPart = 'https://secure.x-cart.com/customer.php?target=generate_invoice&action=buy&';
         $urlParamsAggregated = array();
         $i = 1;
         foreach ($keys as $key) {
             $entityID = 'CDev' == $key->getAuthor() && 'Core' == $key->getName() ? \XLite\Upgrade\Cell::CORE_IDENTIFIER : $key->getAuthor() . '\\' . $key->getName();
             $keyData = $key->getKeyData();
             if (!empty($keyData['message']) && in_array($entityID, array_keys($entries))) {
                 $urlParamsAggregated[] = $this->getKeyURLParams($i++, $key);
                 $title = isset($entries[$entityID]) ? sprintf('%s (%s)', $entries[$entityID]->getName(), $entries[$entityID]->getAuthor()) : sprintf('%s (%s)', $key->getName(), $key->getAuthor());
                 $this->expiredKeys[] = array('title' => $title, 'expDate' => \XLite\Core\Converter::formatDate($keyData['expDate']), 'purchaseURL' => $commonURLPart . $this->getKeyURLParams(1, $key) . '&proxy_checkout=1');
             }
         }
         $this->allKeysPurchaseURL = $urlParamsAggregated ? $commonURLPart . implode('&', $urlParamsAggregated) . '&proxy_checkout=1' : null;
     }
     return $this->expiredKeys;
 }
开发者ID:kirkbauer2,项目名称:kirkxc,代码行数:27,代码来源:Upgrade.php

示例4: getDayDate

 /**
  * Get day of the given date
  *
  * @param integer $date Date (UNIX timestamp)
  *
  * @return string
  */
 protected function getDayDate($date)
 {
     return \XLite\Core\Converter::formatDate($date);
 }
开发者ID:kewaunited,项目名称:xcart,代码行数:11,代码来源:OrderHistoryAbstract.php

示例5: getValueAsString

 /**
  * Get widget value as string
  *
  * @return string
  */
 public function getValueAsString()
 {
     return 0 >= $this->getParam(self::PARAM_VALUE) ? '' : \XLite\Core\Converter::formatDate($this->getParam(self::PARAM_VALUE), null, false);
 }
开发者ID:kirkbauer2,项目名称:kirkxc,代码行数:9,代码来源:DatePicker.php

示例6: formatDate

 /**
  * Format date
  *
  * @param mixed  $base   String or object instance to get field value from
  * @param string $field  Field to get value OPTIONAL
  * @param string $format Date format OPTIONAL
  *
  * @return string
  */
 protected function formatDate($base, $field = null, $format = null)
 {
     if (is_object($base)) {
         $base = $base instanceof \XLite\Model\AEntity ? $base->{$field} : $base->get($field);
     }
     return \XLite\Core\Converter::formatDate($base, $format);
 }
开发者ID:kirkbauer2,项目名称:kirkxc,代码行数:16,代码来源:AView.php

示例7: getCurrentYear

 /**
  * getCurrentYear
  *
  * @return string
  */
 protected function getCurrentYear()
 {
     return \XLite\Core\Converter::formatDate(time(), '%Y');
 }
开发者ID:kingsj,项目名称:core,代码行数:9,代码来源:PoweredBy.php

示例8: getDefaultOptions

 /**
  * Get default options
  *
  * @return array
  */
 protected function getDefaultOptions()
 {
     $time = time();
     return array('%T' => \XLite\Core\Converter::formatDate($time, '%T'), '%H:%M' => \XLite\Core\Converter::formatDate($time, '%H:%M'), '%I:%M %p' => \XLite\Core\Converter::formatDate($time, '%I:%M %p'), '%r' => \XLite\Core\Converter::formatDate($time, '%r'));
 }
开发者ID:kingsj,项目名称:core,代码行数:10,代码来源:TimeFormat.php

示例9: getPackExportDate

 /**
  * Get last export date
  *
  * @return string
  */
 protected function getPackExportDate()
 {
     $list = $this->getPackedFiles();
     $file = $list ? new \SplFileInfo(current($list)) : null;
     $date = date('Y-m-d');
     if ($file) {
         $date = \XLite\Core\Converter::formatDate($file->getMTime(), '%Y-%m-%d');
     }
     return $date;
 }
开发者ID:kirkbauer2,项目名称:kirkxc,代码行数:15,代码来源:Generator.php

示例10: getCommonAttributes

 /**
  * getCommonAttributes
  *
  * @return array
  */
 protected function getCommonAttributes()
 {
     $list = parent::getCommonAttributes();
     if (is_numeric($list['value']) || is_int($list['value'])) {
         $list['value'] = $list['value'] ? \XLite\Core\Converter::formatDate($list['value']) : '';
     }
     return $list;
 }
开发者ID:kirkbauer2,项目名称:kirkxc,代码行数:13,代码来源:Date.php

示例11: getCompanyYear

 /**
  * Get company year
  *
  * @return string
  */
 protected function getCompanyYear()
 {
     $currentYear = intval(\XLite\Core\Converter::formatDate(\XLite\Core\Converter::time(), '%Y'));
     $startYear = \XLite::isAdminZone() ? 2002 : intval(\XLite\Core\Config::getInstance()->Company->start_year);
     return $startYear && $startYear < $currentYear ? $startYear . ' - ' . $currentYear : $currentYear;
 }
开发者ID:kirkbauer2,项目名称:kirkxc,代码行数:11,代码来源:PoweredBy.php

示例12: getLastExportDate

 /**
  * Get last export date
  *
  * @return string
  */
 protected function getLastExportDate()
 {
     $list = $this->getDownloadFiles();
     $file = $list ? current($list) : null;
     return \XLite\Core\Converter::formatDate($file ? $file->getMTime() : \XLite\Core\Converter::time());
 }
开发者ID:kirkbauer2,项目名称:kirkxc,代码行数:11,代码来源:Download.php

示例13: getDefaultOptions

 /**
  * Get default options
  *
  * @return array
  */
 protected function getDefaultOptions()
 {
     $time = time();
     return array('%m/%d/%Y' => \XLite\Core\Converter::formatDate($time, '%m/%d/%Y'), '%b %e, %Y' => \XLite\Core\Converter::formatDate($time, '%b %e, %Y'), '%d.%m.%Y' => \XLite\Core\Converter::formatDate($time, '%d.%m.%Y'));
 }
开发者ID:kingsj,项目名称:core,代码行数:10,代码来源:DateFormat.php


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