Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Limiting date filter year › Reply To: Limiting date filter year
August 8, 2025 at 9:04 pm
#55198
Keymaster
Hi,
Well, that can’t be adjusted on the back-end, but it can be programmatically via a custom code snippet:
add_action('wp_footer', 'wp_footer_datepicker_range_fix', 9999);
function wp_footer_datepicker_range_fix() {
?>
<script>
(function($){
setTimeout(function(){
$('.asp_w .hasDatepicker').datepicker('option', 'yearRange', '-9:+1')
}, 500);
})(jQuery);
</script>
<?php
}
This snippet above will adjust the year range from -9 to +1 years, meaning 2016 to 2026. You can change that on the 6th line as you need it.