/** * Date 'from-to' filter HTML with values * * @param Mage_Eav_Model_Entity_Attribute $attribute * @param mixed $value * @return string */ protected function _getDateFromToHtmlWithValue(Mage_Eav_Model_Entity_Attribute $attribute, $value) { $dateBlock = new Mage_Core_Block_Html_Date(array('name' => $this->getFilterElementName($attribute->getAttributeCode()) . '[]', 'id' => $this->getFilterElementId($attribute->getAttributeCode()), 'class' => 'input-text input-text-range-date', 'format' => Mage::app()->getLocale()->getDateFormat(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT), 'image' => $this->getSkinUrl('images/grid-cal.gif'))); $fromValue = null; $toValue = null; if (is_array($value) && count($value) == 2) { $fromValue = $this->_helper->escapeHtml(reset($value)); $toValue = $this->_helper->escapeHtml(next($value)); } return '<strong>' . Mage::helper('Mage_ImportExport_Helper_Data')->__('From') . ':</strong> ' . $dateBlock->setValue($fromValue)->getHtml() . ' <strong>' . Mage::helper('Mage_ImportExport_Helper_Data')->__('To') . ':</strong> ' . $dateBlock->setId($dateBlock->getId() . '_to')->setValue($toValue)->getHtml(); }
/** * Date 'from-to' filter HTML. * * @param Mage_Eav_Model_Entity_Attribute $attribute * @return string */ protected function _getDateFromToHtml(Mage_Eav_Model_Entity_Attribute $attribute) { $dateBlock = new Mage_Core_Block_Html_Date(array('name' => $this->getFilterElementName($attribute->getAttributeCode()) . '[]', 'id' => $this->getFilterElementId($attribute->getAttributeCode()), 'class' => 'input-text', 'format' => Mage::app()->getLocale()->getDateFormat(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT), 'extra_params' => 'style="width:85px !important"', 'image' => $this->getSkinUrl('images/grid-cal.gif'))); return '<strong>' . $this->_helper->__('From') . ':</strong> ' . $dateBlock->getHtml() . ' <strong>' . $this->_helper->__('To') . ':</strong> ' . $dateBlock->setId($dateBlock->getId() . '_to')->getHtml(); }