The native js calendar code on the webpage. When you click the text prompt, a calendar window with year, month, and date is displayed. You can adjust the year, month, and date, it is used on web pages to help you select dates and improve user experience. All major browsers can run normally. For more information, see. Instructions for use:
You need to introduce the plug-in calendar. js/calendar. min. js.
You must import the calendar.css style sheet to customize your desired skin.
The calendar plug-in supports cmd modularization.
Call the following code:
XvDate ({'targetid': 'date1', // the id of the Time-written object 'triggerid': ['date1', 'datepart1'], // The event triggering Object id 'alignid': 'dateswrap1', // The calendar alignid': '-', // The default time format is 'yyyy-MM-DD HH: MM: SS 'Min': '2017-09-20 10:00:00 ', // maximum time 'max': '2017-10-30 10:00:00 '// minimum time });
Parameter description:
TargetId: id of the date written object. It cannot be blank.
TriggerId: the id of the object that triggers the event. If this parameter is not set, the default value is targetId.
AlignId: alignId of the Calendar box. If this parameter is not set, the default value is targetId.
Hms: Indicates whether to enable the time/minute/second mode. The default value is 'on', which indicates that the time/minute/second mode is enabled (10:00:00), and 'off' indicates that the time/minute/second mode is disabled)
Format: the default value of the date format is '-' (). '/' indicates)
Min: minimum time limit. The time format of min remains the same as the previous time format.
Max: maximum time limit. The time format of max is consistent with the previous time format.
ZIndex: maximum time limit. The hierarchy of the Calendar box. The default value is 9999.
If you need to use modularization, you can use it to introduce the modules that require dependency.
For example:
define('mod1',[],function(require, exports, module){var xvDate = require("xvDate");})
The above is all the content of this article. I hope you will like it.
For more light-weight native js calendar plug-in calendar. js User Guide articles, please follow the PHP Chinese network!