Exemple #1
0
 /**
  * @inheritdoc
  */
 public function process(array $params, \Smarty_Internal_Template $smarty)
 {
     $format = isset($params['format']) ? $params['format'] : 'long';
     if (isset($params['start']) && isset($params['end'])) {
         return $this->dateRangeFormatter->formatTimeRange($params['start'], $params['end'], $format);
     } elseif (isset($params['start'])) {
         return $this->dateRangeFormatter->formatTimeRange($params['start'], '', $format);
     }
     return '';
 }
Exemple #2
0
 /**
  * @inheritdoc
  */
 protected function getValue(array $column, array $dbResultRow)
 {
     $field = $this->getFirstDbField($column);
     $value = $this->getDbValueIfExists($dbResultRow, $field);
     if ($value === null) {
         $value = $this->getDefaultValue($column);
     } else {
         $fields = $this->getDbFields($column);
         $value = $this->dateRangeHelper->formatTimeRange($value, $this->getDbValueIfExists($dbResultRow, next($fields)));
     }
     return $value;
 }