/** * 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(); }
/** * 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(); }
/** * 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); }
/** * 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(); }