Example #1
0
 /**
  * Prepare component configuration
  *
  * @return void
  */
 public function prepare()
 {
     $config = $this->getData('config');
     if (!isset($config['dateFormat'])) {
         $config['dateFormat'] = $this->localeDate->getDateTimeFormat(\IntlDateFormatter::MEDIUM);
         $this->setData('config', $config);
     }
     parent::prepare();
 }
Example #2
0
 /**
  * Prepare component configuration
  *
  * @return void
  */
 public function prepare()
 {
     $config = $this->getData('config');
     if (!isset($config['timeOffset'])) {
         $config['timeOffset'] = (new \DateTime('now', new \DateTimeZone($this->localeDate->getConfigTimezone())))->getOffset();
     }
     $this->setData('config', $config);
     parent::prepare();
 }
Example #3
0
 /**
  * Prepare component configuration
  *
  * @return void
  */
 public function prepare()
 {
     parent::prepare();
     $config = $this->getData('config');
     if (!isset($config['dateFormat'])) {
         $config['dateFormat'] = $this->localeDate->getDateTimeFormat(\IntlDateFormatter::MEDIUM);
         $this->setData('config', $config);
     }
     $jsConfig = $this->getConfiguration($this);
     $this->getContext()->addComponentDefinition($this->getComponentName(), $jsConfig);
 }
Example #4
0
 /**
  * Prepare component configuration
  *
  * @return void
  */
 public function prepare()
 {
     $config = $this->getData('config');
     if (!isset($config['timeOffset'])) {
         $config['timeOffset'] = (new \DateTime('now', new \DateTimeZone($this->localeDate->getConfigTimezone())))->getOffset();
     }
     if (!isset($config['timeFormat'])) {
         $config['timeFormat'] = $this->localeDate->getTimeFormat(\IntlDateFormatter::SHORT);
     }
     if (!isset($config['dateFormat'])) {
         $config['dateFormat'] = $this->localeDate->getDateFormat(\IntlDateFormatter::MEDIUM);
     }
     $this->setData('config', $config);
     parent::prepare();
 }