Calendar JS Plugin

Source: Internet
Author: User
Tags time and date time and seconds

Because a training management module has been done, there is a start and end training time. Time and date if a user enters it manually, even if you request a time format, the user may still be in the wrong time format. So think about it, or find a JS calendar plugin. Let me introduce my own experience.

The first step. Download it first. Address: Http://www.my97.net/dp/down/My97DatePickerBeta.zip

Download it and you will see a demo page and a JS folder. In the demonstration page, the explanation is very clear, this is very grateful to the predecessors AH. From the page introduction is not difficult to find that the calendar plugin has been updated, fixed some bugs, also recommended to use the latest version, at this time I am using the latest version.

The Demo page explains a lot, but we're just going to use the 12th line of code. As follows:

<script language= "javascript" type= "Text/javascript" src= "My97datepicker/wdatepicker.js" ></script>

<input class= "Wdate" type= "text" onclick= "Wdatepicker ()" >

Put the code where you need the calendar. Notice that you modify the JS pointer to the path, and modify it to your own. JS folder "My97datepicker" If you feel long can be modified, but do not modify the file name in the folder.

The second step. Modify as needed.

The Downloaded Demo page date is a date that does not contain time and seconds, and if necessary, it can be modified by configuration. Such as:

<script language= "javascript" type= "Text/javascript" src= "__public__/calendar/wdatepicker.js" ></script >
<input class= "Wdate" type= "text" onclick= "Wdatepicker ({startdate: '%y-%m-01 00:00:00 ', datefmt: ' Yyyy-MM-dd HH: Mm:ss ', alwaysusestartdate:true}) ">

Add a red flag to show the time format of the Yyyy-mm-dd HH:mm:ss. For further details, refer to:

Http://www.my97.net/dp/demo/index.htm

The third step. Eliminate the need for files to slim down.

The "My97datepicker" folder contains also multiple languages, as well as skin settings. If I don't need this, then I can get rid of it. I removed the Lang language Pack and the development package. Skins are skin style package, originally was removed, and later felt not good-looking, plus. Well, the JS calendar plugin is finished.

 

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.