How to change a date picker (years) range?

   —   
There is a similar solution in the Kentico forums which will not work when using newer versions of Kentico CMS; this is because the Date Picker was changed from the default .NET, to a JavaScript file using the jQuery library.
You can find the code below in the file your_site\CMSScripts\jquery\jquery-ui-datetimepicker.js around line number: 388:
yearRange: 'c-10:c+10', // Range of years to display in drop-down,

you can change it to:
yearRange: 'c-20:c+20', // Range of years to display in drop-down,

Please note: you should completely delete the browsers cache since the JavaScript is cached, or test your changes in a different browser...just to confirm the changes were made ok.

Before:                                              After:


See also: Date picker only goes to 2005 (for older versions)

Applies to: Kentico CMS version 6.x,7.x
Share this article on   LinkedIn

Martin Danko

Let me guide you on your journey of success. I will show you how to optimize your content production with Kentico Draft. Check out www.kenticocloud.com