JS Multi-Select date control

Source: Internet
Author: User

JS Multi-Select date control

For details, see: http://www.lovewebgames.com/jsmodule/calendar.html

It's github address: Https://github.com/tianxiangbing/calendar

Calendar

JS Calendar Control

Usage
    <input type="text" id="calendar" value="2015-04-15"/>    <script src="../src/jquery-1.9.1.min.js"></script>    <script src="../src/calendar.js"></script>    <script>        var calendar = new Calendar();        calendar.init({            target: $(‘#calendar‘),            range: [‘2015-3-5‘, ‘2015-3-25‘],            multiple: true,            maxdays: 5,            overdays: function(a) {                alert(‘添加已达上限 ‘ + a + ‘ 天‘);            }        });    </script>
Or
    <input type="text" class="calendar" value="2015-03-14"/>    <input type="text" class="calendar2" value="2015-03-18"/>    <script src="../dist/jquery-1.9.1.min.js"></script>    <script src="../dist/calendar-jquery.min.js"></script>    <script>        $(".calendar").Calendar({toolbar:true});        $(".calendar2").Calendar();    </script>
Property and Method Properties Date:
    当前日期.
Toolbar:bool
    是否显示下方操作栏
Separator
    日期分隔符,默认"-".
Id:
    日历容器ID
Calendarcontainer:
    日历容器对象
Dayarr:
    [‘日‘, ‘一‘, ‘二‘, ‘三‘, ‘四‘, ‘五‘, ‘六‘]
Montharr:
    ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"]
Isshow: Whether to display medium Maxdays: Maximum number of days in multiple selection method Setrange:function (range)
设置日期可选范围的方法
Init:function (settings) settings parameter focusdate:
    当前选中日期{{2015-01-02}}
Target
    触发日历的事件结点,可以是input或其他标签,如果是input会默认取value作为focusDate,    否则取target的前一个input的value值,或取当前时间.
Selected:function (A, B)
    选中后的回调事件,参数为(a)时间对象 ,(b)日历容器
Beforeselect:function (A, B)
    选择前触发方法,参数为(a)时间对象 ,(b)日历容器
Overdays:function (Daysnum)
    超出限定天数时的回调(多选时)
Release history
    1. 2015-03-15 v1.0.1 Add jquery plug-in notation
2.2015-03-12 v1.0.0

Task submitted by field think soldier

JS Multi-Select date control

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.