【问题标题】:magento add calender date picker to custom form in admin (custom module)magento 将日历日期选择器添加到管理中的自定义表单(自定义模块)
【发布时间】:2015-06-20 11:10:56
【问题描述】:

我已经从 - Modulecreator 创建了自定义模块。
现在我想在我的自定义表单中添加日历日期选择器字段 -(在管理端)。
就像 From date To date
从日期选择器中选择的值应在提交时添加到数据库中。
谢谢。

【问题讨论】:

    标签: calendar magento


    【解决方案1】:
    $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') )
    ));
    

    【讨论】:

    • 有了这个,我能问一下如何添加多个日期吗?也许一个小添加按钮,然后添加另一个日期?数据库模式,可能类似于序列化数组?
    猜你喜欢
    • 2023-03-30
    • 2019-08-01
    • 1970-01-01
    • 2011-09-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多