public static function lastUpdateFilterList() { if (!file_exists(WORKSPACE . self::$file)) { return false; } return DateTimeObj::get(DateTimeObj::getSetting('datetime_format'), filemtime(WORKSPACE . self::$file)); }
public function prepareTableValue($data, XMLElement $link = NULL, $entry_id = null) { $value = null; if (isset($data['value'])) { $value = DateTimeObj::format($data['value'], DateTimeObj::getSetting('datetime_format'), true); } return parent::prepareTableValue(array('value' => $value), $link, $entry_id = null); }
/** * Format the $data parameter according to this field's settings. * * @since Symphony 2.6.0 * @param array $date * The date to format * @return string */ public function formatDate($date) { // Get format $format = 'date_format'; if ($this->get('time') === 'yes') { $format = 'datetime_format'; } return DateTimeObj::format($date, DateTimeObj::getSetting($format)); }
public function prepareTextValue($data, $entry_id = null) { $value = ''; if (isset($data['value'])) { $value = DateTimeObj::format($data['value'], DateTimeObj::getSetting('datetime_format'), true); } return $value; }
/** * Generates a XMLElement representation of a Symphony calendar. * * @since Symphony 2.6 * @param boolean $time * Wheather or not to display the time, defaults to true * @return XMLElement */ public static function Calendar($time = true) { $calendar = new XMLElement('div'); $calendar->setAttribute('class', 'calendar'); $date = DateTimeObj::convertDateToMoment(DateTimeObj::getSetting('date_format')); if ($date) { if ($time === true) { $separator = DateTimeObj::getSetting('datetime_separator'); $time = DateTimeObj::convertTimeToMoment(DateTimeObj::getSetting('time_format')); $calendar->setAttribute('data-calendar', 'datetime'); $calendar->setAttribute('data-format', $date . $separator . $time); } else { $calendar->setAttribute('data-calendar', 'date'); $calendar->setAttribute('data-format', $date); } } return $calendar; }