| 123456789101112131415161718192021222324252627 |
- <?php
- namespace common\libs\dataList\column;
- class DateTime extends AbstractColumn implements InterfaceColumn {
- public $format = 'Y-m-d H:i:s';
- public function __construct($config = []) {
- parent::__construct($config);
- }
- public function setFormat($format){
- $this->format = $format;
- return $this;
- }
- public function result(){
- $value = $this->getValue();
- if(!$value){
- return $this->defaultText;
- }
- return date($this->format, $value);
- }
- }
|