html5-fallback.js (643B)
1 ( function( $ ) { 2 $( function() { 3 var supportHtml5 = ( function() { 4 var features = {}; 5 var input = document.createElement( 'input' ); 6 var inputTypes = [ 'date' ]; 7 8 $.each( inputTypes, function( index, value ) { 9 input.setAttribute( 'type', value ); 10 features[ value ] = input.type !== 'text'; 11 } ); 12 13 return features; 14 } )(); 15 16 if ( ! supportHtml5.date ) { 17 $( 'input.wpcf7-date[type="date"]' ).each( function() { 18 $( this ).datepicker( { 19 dateFormat: 'yy-mm-dd', 20 minDate: new Date( $( this ).attr( 'min' ) ), 21 maxDate: new Date( $( this ).attr( 'max' ) ) 22 } ); 23 } ); 24 } 25 } ); 26 } )( jQuery );