. */ /** * Simple date column */ class DateColumn extends TextColumn { /** * Constructor * * @param string name of the column (as provided in the parameter of getCellValue()) * @param string header value */ public function __construct($name, $header) { parent::__construct($name, $header); } public function getCellValue($rowNum, $row) { if( $row[$this->name] == "0000-00-00 00:00:00" OR $row[$this->name] == "0000-00-00" ) return ""; elseif( strlen($row[$this->name])==10 ) return date("d.m.Y", strtotime($row[$this->name])); elseif( strlen($row[$this->name])==16 ) return date("d.m.Y H:i", strtotime($row[$this->name])); elseif( strlen($row[$this->name])==19 ) return date("d.m.Y H:i:s", strtotime($row[$this->name])); else return $row[$this->name]; } } ?>