我已经从 - Modulecreator 创建了自定义模块。现在我想在我的自定义表单中添加日历日期选择器字段 -(在管理端)。像 From date To date .
从日期选择器中选择的值应在提交时添加到数据库中。谢谢。
请您参考如下方法:
$fieldset->addField('date', 'date', array(
'name' => 'date',
'label' => Mage::helper('your_module_name')->__('Date'),
'after_element_html' => '<small>Comments</small>',
'tabindex' => 1,
'image' => $this->getSkinUrl('images/grid-cal.gif'),
'format' => Mage::app()->getLocale()->getDateFormat(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT) ,
'value' => date( Mage::app()->getLocale()->getDateStrFormat(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT),
strtotime('next weekday') )
));




