小编jum*_*pao的帖子

如何在日期中显示年份选择下降?

你如何按降序显示年份?目前,我有这个:

<%= f.input :year_started, as: :date, label: "Date started", start_year: Date.today.year - 100, end_year: Date.today.year, discard_day: true, order: [:month, :year], include_blank: true, default: nil, :input_html => { :class => 'profile-date' } %>
Run Code Online (Sandbox Code Playgroud)

下拉年显示如下:

1900
1901
1902
....
2015
Run Code Online (Sandbox Code Playgroud)

我想要相反,你怎么做?:

2015
2014
2013
....
1900
Run Code Online (Sandbox Code Playgroud)

谢谢.

ruby-on-rails simple-form ruby-on-rails-4

2
推荐指数
1
解决办法
707
查看次数