【问题标题】:How to change datetime intervals in Formtastic如何在 Formtastic 中更改日期时间间隔
【发布时间】:2011-04-26 08:52:28
【问题描述】:

Formtastic 目前自动为日期时间输入创建 1..59 的范围。

但是,如果我希望日期时间分钟选项为 0、15、30、45,该怎么办?

有没有办法可以在 Formastic 中为日期时间设置集合?

提前致谢

【问题讨论】:

    标签: ruby-on-rails ruby forms formtastic


    【解决方案1】:

    你可以尝试使用:minute_step => 15选项,例如:

    <%= form.input :created_at, :minute_step => 15 %>
    

    看看select_minute Rails method docstime_select

    看起来 Formtastic 使用 Rails select_* 方法。

    【讨论】:

      【解决方案2】:

      【讨论】:

        猜你喜欢
        • 2019-12-19
        • 1970-01-01
        • 2015-09-19
        • 1970-01-01
        • 1970-01-01
        • 2019-12-23
        • 1970-01-01
        • 2019-12-26
        • 2020-09-26
        相关资源
        最近更新 更多