Title: [Bug?] Date picker default display range
Last modified: August 29, 2021

---

# [Bug?] Date picker default display range

 *  Resolved [px07](https://wordpress.org/support/users/px07/)
 * (@px07)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/bug-date-picker-default-display-range/)
 * 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](https://wordpress.org/support/users/themehigh/)
 * (@themehigh)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/bug-date-picker-default-display-range/#post-14822028)
 * 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.

 * ![](https://ps.w.org/woo-extra-product-options/assets/icon-256x256.gif?rev=3241643)
 * [Extra Product Options For WooCommerce | Custom Product Addons and Fields](https://wordpress.org/plugins/woo-extra-product-options/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woo-extra-product-options/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woo-extra-product-options/)
 * [Active Topics](https://wordpress.org/support/plugin/woo-extra-product-options/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woo-extra-product-options/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woo-extra-product-options/reviews/)

## Tags

 * [date picker](https://wordpress.org/support/topic-tag/date-picker/)

 * 1 reply
 * 2 participants
 * Last reply from: [ThemeHigh](https://wordpress.org/support/users/themehigh/)
 * Last activity: [4 years, 9 months ago](https://wordpress.org/support/topic/bug-date-picker-default-display-range/#post-14822028)
 * Status: resolved