SoFunction
Updated on 2025-03-10

Lightweight native js calendar plugin usage guide

Instructions for use:

Need to introduce plugins/

You need to introduce a style sheet to customize the skin you want

This calendar plug-in supports cmd modularity

Called as follows:

Copy the codeThe code is as follows:

xvDate({
'targetId':'date1',//Time writes the id of the object
'triggerId':['date1','dateBtn1'],//The object id that triggered the event
'alignId':'datesWrap1', //Calendar alignment object
'format':'-',//Time format Default 'YYY-MM-DD HH:MM:SS'
'min':'2014-09-20 10:00:00',//Maximum time
'max':'2014-10-30 10:00:00'//Minimum time
});

Parameter description:

targetId: The id of the date written to the object, cannot be empty
triggerId: The object id that triggers the event, if not set, the default is targetId
alignId: The alignment benchmark of the calendar box. If not set, the default is targetId.
hms: Whether the hour, minute and second is on, the default value is 'on', which means that the hour, minute and second is on (2014-09-20 10:00:00), and 'off' means that the hour, minute and second mode is off (2014-09-20)
format: is date format. The default value is '-' (2014-09-20), and '/' means (2014/09/20)
min: Minimum time limit, the time format of min and the previous time format remain the same
max: Maximum time limit, max's time format and previous time format remain the same
zIndex: Maximum time limit, level of calendar box, default 9999

If you need to use modularity, you can use it to introduce it in modules you need to rely on.

like:

Copy the codeThe code is as follows:

define('mod1',[],function(require, exports, module){
var xvDate = require("xvDate");
})

Download address

The above is the entire content of this article, I hope you like it.