Home › Forums › General Issues › Date Picker question › Reply To: Date Picker question

The ACF Date Picker field actually uses the jQuery UI Datepicker. By default, its year range is from 1925 up to the current year.
You can write custom JS to override the yearRange option:
add_action('acf/input/admin_footer', function() {
?>
<script type="text/javascript">
(function($) {
if (typeof acf !== 'undefined') {
acf.add_action('ready_field/type=date_picker', function($field){
$field.find('input.input').datepicker('option', {
yearRange: '1800:c', // 1800 from a specific year up to the current year.
changeMonth: true,
changeYear: true
});
});
}
})(jQuery);
</script>
<?php
});
This way, you can easily select years like 1800 or even earlier.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.