コード例 #1
0
ファイル: Date.php プロジェクト: pradeep-wagento/magento2
 /**
  * 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();
 }
コード例 #2
0
ファイル: Date.php プロジェクト: Doability/magento2dev
 /**
  * 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();
 }
コード例 #3
0
ファイル: Date.php プロジェクト: opexsw/magento2
 /**
  * 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);
 }
コード例 #4
0
ファイル: Date.php プロジェクト: rafaelstz/magento2
 /**
  * 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();
 }