开发者

How to start the date_select in the middle of the years in the filed

I am using the Rails date_select helper.开发者_运维技巧

:start_year => Time.now.year

:end_year => 1910

I would like the year the user sees when they click to be 1980 which is not the start year or end year.

Is there a way to do this with jquery?

Thanks


You can pass the Date object to the :default option. In your case it's date_select(:start_year => Time.now.year, :end_year => 1910, :default => Date.new(1980) )

Docs for the date_select helper

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜