Sha256: a0e895bd31ff68093a5b39f1980d1fad71e6d4cbbd9eee0c784d4965494c4ef3

Contents?: true

Size: 1.37 KB

Versions: 4

Compression:

Stored size: 1.37 KB

Contents

<div class="form-group <%= form.error_class field_name %>">
  <%= form.label field_name, metadata[:label] %>
  <div class="row">
    <div class="col-xs-6 col-sm-3">
      <div class="input-group date" data-init='datetimepicker'>
        <span class="input-group-addon">F</span>
        <%= form.text_field field_name, value: value.try(:first), multiple: true, class: 'form-control' %>
        <span class="input-group-addon"><%= icon 'calendar' %></span>
      </div>
    </div>
    <div class="col-xs-6 col-sm-3">
      <div class="input-group date" data-init='datetimepicker'>
        <span class="input-group-addon">T</span>
        <%= form.text_field field_name, value: value.try(:last), multiple: true, class: 'form-control' %>
        <span class="input-group-addon"><%= icon 'calendar' %></span>
      </div>
    </div>
  </div>
  <%= form.error_messages field_name %>
</div>

<% unless @datetimepicker_init %>
  <% @datetimepicker_init = true %>
  <% content_for :custom_javascript do %>
    <% javascript_tag do %>
      jQuery(function($) {
        $('[data-init="datetimepicker"]').each(function() {
          var $input = $('input', this)
          $input.val(moment($input.attr('value')).format('YYYY-MM-DD HH:mm'))
          $(this).datetimepicker({
            format: 'YYYY-MM-DD HH:mm',
            sideBySide: true
          })
        })
      })
    <% end %>
  <% end %>
<% end %>

Version data entries

4 entries across 2 versions & 1 rubygems

Version Path
wallaby-4.1.6 app/views/wallaby/resources/form/_tsrange.html.erb
wallaby-4.1.6 app/views/wallaby/resources/form/_tstzrange.html.erb
wallaby-5.0.1 app/views/wallaby/resources/form/_tsrange.html.erb
wallaby-5.0.1 app/views/wallaby/resources/form/_tstzrange.html.erb