Sha256: c2053618993ee5fac661930c7982bee3202f3ce71855efc5f89f9229a73889e0

Contents?: true

Size: 905 Bytes

Versions: 2

Compression:

Stored size: 905 Bytes

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='timepicker'>
        <%= form.time_field field_name, value: value, class: 'form-control' %>
        <span class="input-group-addon"><%= icon 'time' %></span>
      </div>
    </div>
  </div>
  <%= form.error_messages field_name %>
</div>

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

Version data entries

2 entries across 2 versions & 1 rubygems

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