original by
When making a system, it is sometimes necessary to block out certain special dates, such as Sunday or statutory holidays, as well as the dates of some shifts; the use of Wdatepicker can shield off Sunday and most statutory holidays, but it is not easy to deal with the days like qingming or shift. Idea
1: The calendar is not limited, but when selected to validate the selected date (using the onpicking event), do not meet the Cancel
The advantage is that the implementation is simple, the disadvantage is that the calendar is not marked, need to point to know is not allowed
2: When the binding time to initialize a calendar, the month of change also processing a calendar, the date of the non-conforming to special treatment
The advantage is that the user will know what is available and what is not difficult when they use it:
Wdatepicker first binding and then change the parameters will not be updated, and what other dates are required to deal with is not possible in the binding date is all set down, to be dynamically obtained when the month changes, then also can not pass the calendar with the parameters to deal with (changed the parameters are not used) to solve:
Since the calendar is loaded and can be processed through the DOM, then the generated calendar is processed directly
Processed once after loading and processed once every time the month is changed (this example sets Wdatepicker's parameter $crossFrame to false to simplify the DOM structure)
In the example, the date of all multiples of 3 is changed, and the click event changes, and the effect is as follows:
The code is relatively simple:
<! DOCTYPE html>