• Resolved px07

    (@px07)


    Hi,

    It looks like the date picker field is limited by default to only display the range of 20 years (in the year field).

    This results in users thinking that they can not select any year past the what is shown (for example for date of birth use case), especially on mobile.

    I know that you can select earlier years by selecting the earliest one, then opening the date picker again that will show a new range but most users wont know that.

    Many thanks.

Viewing 1 replies (of 1 total)
  • Plugin Author ThemeHigh

    (@themehigh)

    Thank you for bringing this to our attention.

    We will add this in the next version of our plugin.

    Further, to make the years available, please add the below code in your active theme’s functions.php file.

    add_action('wp_footer','th_datepicker_year_range_settings');
    
    function th_datepicker_year_range_settings() {
        ?>
        <script type="text/javascript">
           	(function($){
    	        $(document).ready(function() {
    		        setTimeout(function(){
    			      $('#your_field_name').datepicker("option", "yearRange", '-100:+7');
    			    }, 500);
    	        });
            })(jQuery, window, document)
        </script>
        <?php
    }

    Replace your_field_name with your date picker field name.

    Hope this helps.

    Thank you!

Viewing 1 replies (of 1 total)

The topic ‘[Bug?] Date picker default display range’ is closed to new replies.