corsonr
1/23/2014 - 5:58 PM

WooCommerce / Checkout field editor: define range dates for datepicker field type

WooCommerce / Checkout field editor: define range dates for datepicker field type

add_filter( 'wp_footer' , 'woo_add_checkout_field_date_range_limit' );

/**
 * woo_add_checkout_field_date_range_limit
 *
 * @access      public
 * @since       1.0 
 * @return      void
*/
function woo_add_checkout_field_date_range_limit() {
	
	?>
	<script> 
	  jQuery(function() {
	    jQuery( "#date" ).datepicker({ minDate: -5, maxDate: "+1M +10D" });
	  });
	</script>
	<?php
	
}