FRED™  3.0
FRED™: Framework for Rapid and Easy Development
DateTime.php
Go to the documentation of this file.
1 <?php
2 
4 
6 
7 class DateTime extends \Rsi\Fred\Controller\Widget\Group{
8 
9  protected function init(){
10  $config = [self::DISPLAY => $this->display,self::RIGHT => $this->right];
11  $this->_config += [
12  self::WIDGETS => [
13  'date' => new Widget\Date($config + [self::MIN => $this->min,self::MAX => $this->max]),
14  'time' => new Widget\Time($config)
15  ],
16  self::VALUE_GLUE => ' ',
17  self::FORMAT => '[date] [time]'
18  ];
19  parent::init();
20  }
21 
22  public function clientConfig(){
23  $this->getWidgets();
24  $this->_widgets['time']->date = $this->id . '__date';
25  return parent::clientConfig();
26  }
27 
28  public function dataConvert($value){
29  return $value && $value['date'] && $value['time'] ? $value['date'] . $this->valueGlue . $value['time']->format('H:i:s') : null;
30  }
31 
32 }
$display
Default display mode for widgets.
Definition: Controller.php:24