Lightweight native JS Calendar plugin calendar.js usage Guide

Source: Internet
Author: User
Tags date1 min require time limit

The original JS calendar code on the Web page, the mouse clicks on the text hint, will display a calendar window with years, can adjust the year, month, select date, etc., used on the Web page to facilitate the choice of dates, improve the user experience. All major browsers can operate normally, the need for small partners can refer to.

Instructions for use:

Need to introduce Plug-ins calendar.js/calendar.min.js

Need to introduce the CALENDAR.CSS style sheet, you can customize the skin you want

This calendar plugin supports CMD modularity

Call the following:

The code is as follows:

Xvdate ({

' Targetid ': ' date1 ',//time to write the ID of the object

' Triggerid ': [' date1 ', ' DATEBTN1 '],//object ID that triggers the event

' Alignid ': ' DatesWrap1 ',//Calendar Alignment Object

' Format ': '-',//Time format default ' Yyyy-mm-dd HH:MM:SS '

' min ': ' 2014-09-20 10:00:00 ',//MAX time

' Max ': ' 2014-10-30 10:00:00 '//min time

});

Parameter description:

Targetid: Date Write ID of object, cannot be empty

Triggerid: The object ID that triggers the event, or defaults to Targetid if not set

Alignid: The alignment datum of the Calendar box, or default to Targetid if not set

HMS: Whether the time and minutes are open, the default is ' on ' to indicate seconds (2014-09-20 10:00:00), and ' off ' indicates the time of the shutdown (2014-09-20)

Format: The default value for date formats is '-' (2014-09-20), '/' means (2014/09/20)

min: Min time limit, Min's time format and the previous time format remains

Max: Max time limit, Max's time format and previous time format remain

ZIndex: Maximum time limit, calendar box level, default 9999

If you need to use modularity in the modules you need to rely on

Such as:

The code is as follows:

Define (' Mod1 ', [],function (Require, exports, module) {

var xvdate = require ("Xvdate");

})

Download Address

The above mentioned is the entire content of this article, I hope you can enjoy.

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.