My97DatePicker is a very flexible and easy-to-use date control. Very easy to use.
1. Download the My97DatePicker component package
Download address:https:///jiaoben/
2. Introduce the component js file into the page:
<script type="text/JavaScript" src="My97DatePicker/"></script>
3. Example
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>My97DatePickerDate controls are used</title> </head> <body> <center> <h2>My97DatePickerUse of date control</h2> </center> Basic usage: <input id="" class="Wdate" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd',readOnly:true})" /><br><br> Only choose dates before today: <input id="" class="Wdate" onfocus="WdatePicker({readOnly:true,maxDate:'%y-%M-%d'})" /><br><br> Using operational expressions Only selectable 20Hour ago to 30After a hour Date of <input id="" class="Wdate" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm',minDate:'%y-%M-%d {%H-20}:%m:%s',maxDate:'%y-%M-%d {%H+30}:%m:%s'})" /><br><br> start,End date:<!-- $dp.$ Equivalent to function. --> <input class="Wdate" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd',readOnly:true,maxDate:'#F{$dp.$D(\'edate\')}'})" /> - <input class="Wdate" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd',readOnly:true,minDate:'#F{$dp.$D(\'sdate\')}',startDate:'#F{$dp.$D(\'sdate\',{d:+1})}'})" /><br><br> </body> <script type="text/javascript" src="/js/My97DatePicker/"></script> </html>
To modify the configuration information, justWdatePicker({dateFmt:'yyyy-MM-dd',readOnly:true,maxDate:'#F{$dp.$D(\'edate\')}'})"
Add relevant configuration information
4. Common configuration information.
The configuration information is mainly defined in the { } object of the WdatePicker method of onfocus="WdatePicker({dateFmt:'yyyy-MM-dd',readOnly:true})".
Common configuration information is defined in the file.
var $dp,WdatePicker;(function(){var _={ $wdate:true, $dpPath:"", $crossFrame:true, doubleCalendar:false, //Is it a bimonthly calendar autoUpdateOnChanged:false, position:{}, //Location such as: position:{left:100,top:50} lang:"auto", skin:"default", //skin dateFmt:"yyyy-MM-dd", //Date format realDateFmt:"yyyy-MM-dd", realTimeFmt:"HH:mm:ss", realFullFmt:"%Date %Time", minDate:"1900-01-01 00:00:00", //Minimum date maxDate:"2099-12-31 23:59:59", //Maximum date startDate:"", //Start date alwaysUseStartDate:false, //When the date box is no matter what value, always use startDate as the start date yearOffset:1911, firstDayOfWeek:0, //Customize the first day of the week isShowWeek:false, //Whether to display week highLineWeekDay:true, //Highlight Sunday isShowClear:true, // Whether to display clear isShowToday:true, //Does today be displayed isShowOK:true, //Whether OK is displayed isShowOthers:true, readOnly:false, //Read only qsEnabled:true, errDealMode:0, //Automatic error correction function //0 When entering the error date, it will be prompted first //1 When entering the wrong date, the correct value will be automatically restored to the previous correct value //2 When entering the wrong date, no prompts or changes are made, just a mark, but the date box will not be hidden immediately at this time. autoPickDate:null, //Reasons to select a date by clicking twice //When it is false, it will not be entered automatically when clicking on the date, but must be confirmed before entering // When true, click on the date to return the date value // When null (recommended) Set to false if there is time otherwise set to true specialDates:null, //Special date specialDays:null, //Special Day disabledDates:null, //Invalid date For example: disabledDates:['5$'] disabledDays:null, //Invalid days: disabledDays:[6] opposite:false, //Valid date
This is all about this article about the basic usage of the JS date control My97DatePicker. I hope it will be helpful to everyone's learning and I hope everyone will support me more.