开发者

how to set the default year selected as our current year today?

I have a datepicker of jq开发者_如何学Cuery, but the problem is, the year being displayed is the beginning of what i set, 1940, so how to set the currently selected year as our year to day ,2011 ?

here's my code

$(function(){
  $('#datepicker').datepicker({changeYear: true,changeMonth: true,yearRange:'1940:2010'});
})


It has default date option:

//setter
$( ".selector" ).datepicker( "option", "defaultDate", +7 );

this is what said on jQuery site:

Set the date to highlight on first opening if the field is blank. Specify either an actual date via a Date object or as a string in the current dateFormat, or a number of days from today (e.g. +7) or a string of values and periods ('y' for years, 'm' for months, 'w' for weeks, 'd' for days, e.g. '+1m +7d'), or null for today.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜