1/** 2 * wcj-datepicker. 3 * 4 * @version 1.0.0 5 * @todo maybe_exclude_dates: `date.getDate()`, `date.getFullYear()` 6 * @see maybe_exclude_dates: https://stackoverflow.com/questions/501943/can-the-jquery-ui-datepicker-be-made-to-disable-saturdays-and-sundays-and-holid 7 */ 8 9jQuery(document).ready(function() { 10 jQuery("input[display='date']").each( function () { 11 var mindate = jQuery(this).attr("mindate"); 12 if (mindate === 'zero') { 13 mindate = 0; 14 } 15 var maxdate = jQuery(this).attr("maxdate"); 16 if (maxdate === 'zero') { 17 maxdate = 0; 18 } 19 jQuery(this).datepicker({ 20 dateFormat : jQuery(this).attr("dateformat"), 21 minDate : mindate, 22 maxDate : maxdate, 23 firstDay : jQuery(this).attr("firstday"), 24 changeYear: jQuery(this).attr("changeyear"), 25 yearRange: jQuery(this).attr("yearrange"), 26 beforeShowDay: maybe_exclude_dates, 27 }); 28 function maybe_exclude_dates(date){ 29 var exclude_days = jQuery(this).attr("excludedays"); 30 if (typeof exclude_days !== typeof undefined && exclude_days !== false) { 31 var day = date.getDay(); 32 for (var i = 0; i < exclude_days.length; i++) { 33 if (day == exclude_days[i]) { 34 return [false]; 35 } 36 } 37 } 38 var exclude_months = jQuery(this).attr("excludemonths"); 39 if (typeof exclude_months !== typeof undefined && exclude_months !== false) { 40 var month = date.getMonth() + 1; 41 for (var i = 0; i < exclude_months.length; i++) { 42 if (month == exclude_months[i]) { 43 return [false]; 44 } 45 } 46 } 47 var blocked_dates = jQuery(this).attr("data-blocked_dates"); 48 if (typeof blocked_dates !== typeof undefined && blocked_dates !== false) { 49 var blocked_dates_arr = blocked_dates.split(' '); 50 var datestring = jQuery.datepicker.formatDate(jQuery(this).attr("data-blocked_dates_format"), date); 51 return [ blocked_dates_arr.indexOf(datestring) == -1 ]; 52 } 53 return [true]; 54 } 55 }); 56});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.