Introduction: I was looking for a plug-in this morning. I found that this My97DatePicker plug-in is really powerful. After thinking about it, I found that the operation method of this plug-in is also very simple.
1: First, download a My97DatePicker folder, which can be found on Baidu on the Internet.
2: Import this file into the project that needs to be written, in which WdatePicker.js is imported into the html page that needs to be used. As shown below:
3: Then write code in the body according to the needs of the individual. There are many specific implementations. Here are a few common examples:
(1) Only dates before today (including today) can be selected
<input id="d421" class="Wdate" type="text" onfocus="WdatePicker({skin:'whyGreen',maxDate:'%y-%M-%d'})"/>
(2) Using an arithmetic expression, only dates after today (excluding today) can be selected
<input id="d422" class="Wdate" type="text" onfocus="WdatePicker({ minDate: '%y-% M-#{%d+1}'})"/>
(3)只启用 每个月份的 5日 15日 25日
<input id="d46" type="text" class="Wdate" onFocus="WdatePicker({opposite:true,disabledDates:['5$']})"/>
注意 :'5$' 表示以 5 结尾 注意 $ 的用法
等等,方法很多。
用这个插件可以满足大多数的需求。