/** * Apply configuration specific for different element type * * @param string $inputType * @param \Magento\Framework\Data\Form\Element\AbstractElement $element * @param AttributeMetadataInterface $attribute * @return void */ protected function _applyTypeSpecificConfigCustomer($inputType, $element, AttributeMetadataInterface $attribute) { switch ($inputType) { case 'select': $element->setValues($this->_getAttributeOptionsArray($attribute)); break; case 'multiselect': $element->setValues($this->_getAttributeOptionsArray($attribute)); $element->setCanBeEmpty(true); break; case 'date': $element->setDateFormat($this->_localeDate->getDateFormatWithLongYear()); break; case 'multiline': $element->setLineCount($attribute->getMultilineCount()); break; default: break; } }
/** * Apply configuration specific for different element type * * @param string $inputType * @param \Magento\Framework\Data\Form\Element\AbstractElement $element * @param \Magento\Customer\Service\V1\Data\Eav\AttributeMetadata $attribute * @return void */ protected function _applyTypeSpecificConfigCustomer($inputType, $element, \Magento\Customer\Service\V1\Data\Eav\AttributeMetadata $attribute) { switch ($inputType) { case 'select': $element->setValues($this->_getAttributeOptionsArray($attribute)); break; case 'multiselect': $element->setValues($this->_getAttributeOptionsArray($attribute)); $element->setCanBeEmpty(true); break; case 'date': $element->setImage($this->getViewFileUrl('images/grid-cal.gif')); $element->setDateFormat($this->_localeDate->getDateFormatWithLongYear()); break; case 'multiline': $element->setLineCount($attribute->getMultilineCount()); break; default: break; } }
public function render(\Magento\Framework\Data\Form\Element\AbstractElement $element) { $element->setDateFormat(\Magento\Framework\Stdlib\DateTime::DATE_INTERNAL_FORMAT); $element->setTimeFormat(null); return parent::render($element); }
/** * Apply configuration specific for different element type * * @param string $inputType * @param \Magento\Framework\Data\Form\Element\AbstractElement $element * @param \Magento\Eav\Model\Entity\Attribute $attribute * @return void */ protected function _applyTypeSpecificConfig($inputType, $element, \Magento\Eav\Model\Entity\Attribute $attribute) { switch ($inputType) { case 'select': $element->setValues($attribute->getSource()->getAllOptions(true, true)); break; case 'multiselect': $element->setValues($attribute->getSource()->getAllOptions(false, true)); $element->setCanBeEmpty(true); break; case 'date': $element->setDateFormat($this->_localeDate->getDateFormatWithLongYear()); break; case 'multiline': $element->setLineCount($attribute->getMultilineCount()); break; default: break; } }