开发者

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

开发者 https://www.devze.com 2023-04-04 12:56 出处:网络
I am using the Rails date_select helper.开发者_运维技巧 :start_year => Time.now.year :end_year => 1910

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

精彩评论

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