+ Start a Discussion

How to Extend Date picker's Year using Console component

Need to extend the standarad page date picker's Year using javascript.
Tried with VF page by injecting into the component console.
But due to cross-domain security issues,not able to do.
Any other ways...
Sfdc CloudSfdc Cloud
Hi Suresh
Please Follow below steps:

1) Go to Setup -> App Setup -> Customize -> User Interface. Here make sure the 'Show Custom Sidebar Components on All Pages' is checked.

2) Go to Setup -> App Setup -> Home Page Layouts. Make sure all your Home Page Layouts have the Messages & Alerts component checked.

3) Go to Setup -> App Setup -> Home Page Components. Here, click edit for Messages & Alerts. In the textarea, copy and paste the javascript code below and save (it can just go below your normal Messages & Alerts, won't show up on the actual page).
<script src="/js/dojo/0.4.1/dojo.js"></script>
<script src="/soap/ajax/11.1/connection.js" type="text/javascript"></script>
<script type="text/javascript">
var arYears = getYears();
function swapYears(){
    // Contact Birth day
    if(document.getElementById('calYearPicker') != null) {
        var select = document.getElementById('calYearPicker');
        var curValue = select.value; 
        var parentx = select.parentNode;
        select = document.createElement('select');
        select.size = 1;
        select.id = 'calYearPicker';
        select.name = 'calYearPicker';
    if(select != null) {
        for(x=0;x<100;x++) {        
            select.options[x] = new Option(arYears[x], arYears[x], false, false);
function getYears() {
    sforce.sessionId = getCookie('sid');
    var out = [];
    // generate dates for the last 100 years
    var currentTime = new Date()
    var year = currentTime.getFullYear()
    try {
        for(x=0;x<100;x++) {
            out[x] = x+year-99;

    } catch(error) {
    return out;

Its working fine in my org.
If it will helps out.Mark it for helps others :)
Thanks for your time.
I was able to do with the Sidebar Components as you said.
But in the service cloud I need to do with the custom console component.
In the custom console component I added a VF page and trying to do it.
Of course you will get cross domain security issues,but trying to do in another way.
Is there any other way to extend the date picker which in standard page.