Is there a way to override the default datepicker script? I am trying to change the view because I only want future dates, for 1 year only, and only one month not 3.
I tried the normal way of enqueue-ing a new #datepicker script in functions and loading a file in my js file, but couldn't get it to work.
I saved this as init.js in my js file:
jQuery(document).ready(function($) {
/* For all options see http://jqueryui.com/demos/datepicker/ */
$("#datepicker").datepicker({
defaultDate: +2,
minDate: 0,
maxDate: "+1y",
numberOfMonths: 1,
showAnim: 'fadeIn',
showButtonPanel: true,
buttonImageOnly: true,
buttonText: 'Pick a date',
showOn: 'both'
});
});
and put this in my functions:
add_action('wp_enqueue_scripts', 'my_add_scripts2');
function my_add_scripts2() {
wp_enqueue_script('init', get_template_directory_uri() . '/lib/js/init.js', array('jquery'));
}
But it didn't change anything.