views:

86

answers:

2

How to set jquery.datepick.js to display only the current year in the database?

+2  A: 

If it is the datepicker from JQuery UI you can give it min and max date as arguments like this:

$('#datepicker').datepicker({
    minDate: new Date(2010, 1 , 1), 
    maxDate: new Date(2010,12,31)
});

Hope this helps you

Falle1234
no that doesnt work for me Can i send the jquerycode for ur reference
udaya
Sure you can. I will have a look at it
Falle1234
see my new edit
udaya
@Alaistair that also doesnt work
udaya
@Falle : I got the result I did tis to get the resultHai change the year range from yearRange: '-99:+100', To yearRange: '-1:+100',so that we can get the dates from the year before current year say the dropdown will display the year starting from 2009 since the current year is 2010
udaya
+1  A: 

Hai change the year range from yearRange: '-99:+100', To yearRange: '-1:+100',so that we can get the dates from the year before current year say the dropdown will display the year starting from 2009 since the current year is 2010

udaya