Sha256: 82b9a6bdce68d719439d148d5ede0c108501e7511536923abc703d77d628ba37

Contents?: true

Size: 1.95 KB

Versions: 124

Compression:

Stored size: 1.95 KB

Contents

<%= content_tag(:div,
    id: object.id,
    data: object.data,
    class: object.classname,
    **combined_html_options) do %>
  <%
    # convert deprecated prop values
    size = object.size
    size = "sm" if object.size == "xs"
    size = "md" if object.size == "lg"
  %>

  <% if object.unstyled %>
    <% if object.show_icon %>
      <span>
        <%= pb_rails("icon", props: { icon: "clock", fixed_width: true }) %>
      </span>
    <% end %>

    <%= content_tag(:time, datetime: object.pb_date_time.to_iso) do %>
      <span><%= object.format_time_string %></span>
      <% if object.show_timezone %>
        <span><%= object.pb_date_time.to_timezone.upcase %></span>
      <% end %>
    <% end %>

  <% elsif size == "md" %>
    <% if object.show_icon %>
      <%= pb_rails("body", props: { color: "light", tag: "span"}) do %>
        <%= pb_rails("icon", props: { icon: "clock", fixed_width: true }) %>
      <% end %>
    <% end %>

    <%= content_tag(:time, datetime: object.pb_date_time.to_iso) do %>
      <%= pb_rails("body", props: { tag: "span", text: object.format_time_string, classname: "pb_time" }) %>
      <% if object.show_timezone %>
        <%= pb_rails("body", props: { color: "light", tag: "span", text: object.pb_date_time.to_timezone.upcase }) %>
      <% end %>
    <% end %>

  <% else %>
    <% if object.show_icon %>
      <%= pb_rails("body", props: { color: "light", tag: "span"}) do %>
        <%= pb_rails("icon", props: { icon: "clock", fixed_width: true, size: "sm" }) %>
      <% end %>
    <% end %>

    <%= content_tag(:time, datetime: object.pb_date_time.to_iso) do %>
      <%= pb_rails("caption", props: { color: "light", tag: "span", text: object.format_time_string }) do %>
        <%= object.format_time_string %>
        <% if object.show_timezone %>
          <span class="pb_time_timezone">
            <%= object.pb_date_time.to_timezone.upcase %>
          </span>
        <% end %>
      <% end %>
    <% end %>
  <% end %>
<% end %>

Version data entries

124 entries across 124 versions & 1 rubygems

Version Path
playbook_ui-14.0.0.pre.alpha.PLAY1475bumpaxecoredependency3483 app/pb_kits/playbook/pb_time/time.html.erb
playbook_ui-14.0.0.pre.alpha.PLAY14733479 app/pb_kits/playbook/pb_time/time.html.erb
playbook_ui-14.0.0.pre.alpha.dependabotnpmandyarnreactjoyride2823478 app/pb_kits/playbook/pb_time/time.html.erb
playbook_ui-14.0.0.pre.alpha.PLAY14113475 app/pb_kits/playbook/pb_time/time.html.erb
playbook_ui-14.0.0.pre.alpha.play1447alphatest3462 app/pb_kits/playbook/pb_time/time.html.erb
playbook_ui-14.1.0 app/pb_kits/playbook/pb_time/time.html.erb
playbook_ui-13.34.1.pre.alpha.PLAY14043436 app/pb_kits/playbook/pb_time/time.html.erb
playbook_ui-13.34.1.pre.alpha.pbntr258paginationkitforreact3413 app/pb_kits/playbook/pb_time/time.html.erb
playbook_ui-13.34.1.pre.alpha.pbntr258paginationkitforreact3411 app/pb_kits/playbook/pb_time/time.html.erb
playbook_ui-13.34.1.pre.alpha.pbntr258paginationkitforreact3409 app/pb_kits/playbook/pb_time/time.html.erb
playbook_ui-13.34.1.pre.alpha.pbntr258paginationkitforreact3404 app/pb_kits/playbook/pb_time/time.html.erb
playbook_ui-13.34.1.pre.alpha.powerfontsexternal3403 app/pb_kits/playbook/pb_time/time.html.erb
playbook_ui-14.0.0 app/pb_kits/playbook/pb_time/time.html.erb
playbook_ui-13.34.1.pre.alpha.PLAY14633399 app/pb_kits/playbook/pb_time/time.html.erb
playbook_ui-13.34.1.pre.alpha.play1407statvaluekitinconsistencies3388 app/pb_kits/playbook/pb_time/time.html.erb
playbook_ui-13.34.1.pre.alpha.PLAY14703378 app/pb_kits/playbook/pb_time/time.html.erb
playbook_ui-13.34.0.pre.alpha.PLAY14143373 app/pb_kits/playbook/pb_time/time.html.erb
playbook_ui-13.34.0.pre.alpha.PLAY14143372 app/pb_kits/playbook/pb_time/time.html.erb
playbook_ui-13.34.1 app/pb_kits/playbook/pb_time/time.html.erb
playbook_ui-13.34.0.pre.alpha.PBNTR358responsiveadvancedtablereact3370 app/pb_kits/playbook/pb_time/time.html.erb