/** * 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; }
?> </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>
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); }
/** * @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; } }
public function view() { $this->_Result = Calendar::formatDate(General::sanitize($_GET['date']), General::sanitize($_GET['time']), NULL, true); }