【问题标题】:Issue for increase the date choices for datepicker in f.input增加 f.input 中 datepicker 的日期选择的问题
【发布时间】:2019-03-01 14:05:01
【问题描述】:

我想在我的日期选择器中打开日期范围。它插入到表单输入 中。 从现在开始,用户可以在 2014 -> 2024 之间进行选择 我希望用户可以选择 2005 和 Time.now.year 之间的日期?

【问题讨论】:

  • 我找到了

标签: ruby-on-rails form-for


【解决方案1】:

您可以使用date_select 并指定:start_year 和:end_year:

<%= f.date_select :birthday_date, start_year: Date.new(2005, 01, 01).year, end_year: Date.today.year %>

见:date_select()

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-09-03
    • 1970-01-01
    • 1970-01-01
    • 2018-10-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多