本文整理汇总了PHP中Calendar::formatDate方法的典型用法代码示例。如果您正苦于以下问题:PHP Calendar::formatDate方法的具体用法?PHP Calendar::formatDate怎么用?PHP Calendar::formatDate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Calendar
的用法示例。
在下文中一共展示了Calendar::formatDate方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __viewIndex
/**
* Used to fetch subsection items via an AJAX request.
*/
public function __viewIndex()
{
echo Calendar::formatDate(General::sanitize($_GET['date']), General::sanitize($_GET['time']), NULL, true);
exit;
}
示例2:
?>
</p>
<p><?php
echo $job->country;
?>
</p><br>
<h3>Description</h3>
<p><?php
echo $job->snippet;
?>
</p><br>
<h3>Date Posted</h3>
<p><?php
echo Calendar::formatDate($job->unix_date_posted);
?>
</p><br>
<h3>Source</h3>
<a href="<?php
echo $api->url;
?>
" target="_blank"><img src="<?php
echo Configuration::getAPISourcesImagesPath() . $api->logo;
?>
" alt="<?php
echo $api->name;
?>
"></a>
<br><br>
示例3: parseDateTime
public function parseDateTime($dateString)
{
$dateFormat = 'Y-m-d';
$timeFormat = 'H:i:s';
$format = !$this->get('time') ? "{$dateFormat} 00:00:00" : "{$dateFormat} {$timeFormat}";
return Calendar::formatDate($dateString, true, $format);
}
示例4: processRawFieldData
/**
* @see http://symphony-cms.com/learn/api/2.2/toolkit/field/#processRawFieldData
*/
function processRawFieldData($data, &$status, $simulate = false, $entry_id = NULL)
{
$status = self::__OK__;
if (!is_array($data)) {
return NULL;
}
// Clean up dates
$result = array('start' => array(), 'end' => array());
for ($i = 0; $i < count($data['start']); $i++) {
if (!empty($data['start'][$i])) {
// Parse start date
$parsed = Calendar::formatDate($data['start'][$i], true, 'Y-m-d H:i:s');
$result['start'][] = $parsed['date'];
// Empty end date
if (empty($data['end'][$i])) {
$result['end'][] = $parsed['date'];
} else {
$parsed = Calendar::formatDate($data['end'][$i], true, 'Y-m-d H:i:s');
$result['end'][] = $parsed['date'];
}
}
}
// Result
if (empty($data['start'][0])) {
return NULL;
} else {
return $result;
}
}
示例5: view
public function view()
{
$this->_Result = Calendar::formatDate(General::sanitize($_GET['date']), General::sanitize($_GET['time']), NULL, true);
}