use magento default datepicker plugin in your project

<action method="addItem"><type>js_css</type><name>calendar/calendar-win2k-1.css</name><params/><!--<if/><condition>can_load_calendar_js</condition>--></action>
            <action method="addItem"><type>js</type><name>calendar/calendar.js</name><!--<params/><if/><condition>can_load_calendar_js</condition>--></action>
            <action method="addItem"><type>js</type><name>calendar/lang/calendar-en.js</name><!--<params/><if/><condition>can_load_calendar_js</condition>--></action>
            <action method="addItem"><type>js</type><name>calendar/calendar-setup.js</name><!--<params/><if/><condition>can_load_calendar_js</condition>--></action>
            <block type="core/html_calendar" name="head.calendar" as="calendar" template="catalog/html/js/calendar.phtml"></block>
        </reference>

var valid_date = Calendar.setup({
    inputField : 'valid_date',
    ifFormat : '%Y-%m-%d',
    button : 'date_from_trig',
    singleClick : true
});

posted on 2014-05-07 15:49  冯亮  阅读(192)  评论(0编辑  收藏  举报

导航