Support

Account

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.