1jQuery(document).ready(gformInitDatepicker); 2 3function gformInitDatepicker() { 4 jQuery('.datepicker').each(function () { 5 6 var element = jQuery(this), 7 inputId = this.id, 8 optionsObj = { 9 yearRange: '-100:+20', 10 showOn: 'focus', 11 dateFormat: 'mm/dd/yy', 12 changeMonth: true, 13 changeYear: true, 14 suppressDatePicker: false, 15 onClose: function () { 16 element.focus(); 17 var self = this; 18 this.suppressDatePicker = true; 19 setTimeout( function() { 20 self.suppressDatePicker = false; 21 }, 200 ); 22 }, 23 beforeShow: function( input, inst ) { 24 return ! this.suppressDatePicker; 25 } 26 }; 27 28 if (element.hasClass('dmy')) { 29 optionsObj.dateFormat = 'dd/mm/yy'; 30 } else if (element.hasClass('dmy_dash')) { 31 optionsObj.dateFormat = 'dd-mm-yy'; 32 } else if (element.hasClass('dmy_dot')) { 33 optionsObj.dateFormat = 'dd.mm.yy'; 34 } else if (element.hasClass('ymd_slash')) { 35 optionsObj.dateFormat = 'yy/mm/dd'; 36 } else if (element.hasClass('ymd_dash')) { 37 optionsObj.dateFormat = 'yy-mm-dd'; 38 } else if (element.hasClass('ymd_dot')) { 39 optionsObj.dateFormat = 'yy.mm.dd'; 40 } 41 42 if (element.hasClass('datepicker_with_icon')) { 43 optionsObj.showOn = 'both'; 44 optionsObj.buttonImage = jQuery('#gforms_calendar_icon_' + inputId).val(); 45 optionsObj.buttonImageOnly = true; 46 } 47 48 inputId = inputId.split('_'); 49 50 // allow the user to override the datepicker options object 51 optionsObj = gform.applyFilters('gform_datepicker_options_pre_init', optionsObj, inputId[1], inputId[2]); 52 console.log('init datepicker', element); 53 element.datepicker(optionsObj); 54 }); 55}
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.