Tag: datetimepicker

带有Rails form_for的Bootstrap 3 Datetimepicker

我是一个新的Rails开发人员,我无法使用bootstrap3 datetimepicker和我的rails form_for来保存我的ScheduledAccess模型中的DateTime属性。 我使用的是来自http://eonasdan.github.io/bootstrap-datetimepicker/ 码: .form-group = f.label :start_time datetimepicker1.input-group.date = f.text_field :start_time, class:”form-control”, id:”scheduled_access_start_time” span.input-group-addon span.glyphicon.glyphicon-calendar .form-group = f.label :end_time datetimepicker2.input-group.date = f.text_field :start_time, class:”form-control”, id:”scheduled_access_start_time” span.input-group-addon span.glyphicon.glyphicon-calendar javascript: $(function () { $(‘#datetimepicker1’).datetimepicker( { sideBySide: true }); $(‘#datetimepicker2’).datetimepicker( { sideBySide: true }); }); _fields.html.slim 请注意,当我使用默认的Rails / HTML5日期时,我能够保存到我的ScheduledAccess模型,如下所示。 码: .form-group = f.label :start_time = f.datetime_local_field […]