Sha256: 00ab715f9959309406ada61b9eb4365c4e966267556fd87dfe26d0172928d43a

Contents?: true

Size: 1016 Bytes

Versions: 143

Compression:

Stored size: 1016 Bytes

Contents

# frozen_string_literal: true

module Playbook
  module PbDateRangeInline
    class DateRangeInline
      include ActionView::Helpers::TagHelper
      include ActionView::Context
      include Playbook::Props

      partial "pb_date_range_inline/date_range_inline"

      prop :end_date, type: Playbook::Props::Date, required: true
      prop :start_date, type: Playbook::Props::Date, required: true

      def classname
        generate_classname("pb_date_range_inline_kit")
      end

      def end_date_display
        date_time = Playbook::PbKit::PbDateTime.new(end_date)
        content_tag(:time, datetime: date_time.to_iso) do
          "#{date_time.to_day} #{date_time.to_month_downcase} #{date_time.to_year}"
        end
      end

      def start_date_display
        date_time = Playbook::PbKit::PbDateTime.new(start_date)
        content_tag(:time, datetime: date_time.to_iso) do
          "#{date_time.to_day} #{date_time.to_month_downcase} #{date_time.to_year}"
        end
      end
    end
  end
end

Version data entries

143 entries across 143 versions & 1 rubygems

Version Path
playbook_ui-7.0.1.pre.alpha10 app/pb_kits/playbook/pb_date_range_inline/date_range_inline.rb
playbook_ui-7.0.1.pre.alpha9 app/pb_kits/playbook/pb_date_range_inline/date_range_inline.rb
playbook_ui-6.5.1 app/pb_kits/playbook/pb_date_range_inline/date_range_inline.rb
playbook_ui-6.5.0 app/pb_kits/playbook/pb_date_range_inline/date_range_inline.rb
playbook_ui-7.0.1.pre.alpha8 app/pb_kits/playbook/pb_date_range_inline/date_range_inline.rb
playbook_ui-7.0.1.pre.alpha7 app/pb_kits/playbook/pb_date_range_inline/date_range_inline.rb
playbook_ui-7.0.1.pre.alpha6 app/pb_kits/playbook/pb_date_range_inline/date_range_inline.rb
playbook_ui-7.0.1.pre.alpha5 app/pb_kits/playbook/pb_date_range_inline/date_range_inline.rb
playbook_ui-7.0.1.pre.alpha4 app/pb_kits/playbook/pb_date_range_inline/date_range_inline.rb
playbook_ui-7.0.1.pre.alpha3 app/pb_kits/playbook/pb_date_range_inline/date_range_inline.rb
playbook_ui-7.0.1.pre.alpha2 app/pb_kits/playbook/pb_date_range_inline/date_range_inline.rb
playbook_ui-6.4.2 app/pb_kits/playbook/pb_date_range_inline/date_range_inline.rb
playbook_ui-7.0.1.pre.alpha1 app/pb_kits/playbook/pb_date_range_inline/date_range_inline.rb
playbook_ui-7.0.0.pre.alpha9 app/pb_kits/playbook/pb_date_range_inline/date_range_inline.rb
playbook_ui-7.0.0.pre.alpha8 app/pb_kits/playbook/pb_date_range_inline/date_range_inline.rb
playbook_ui-7.0.0.pre.alpha7 app/pb_kits/playbook/pb_date_range_inline/date_range_inline.rb
playbook_ui-6.4.1 app/pb_kits/playbook/pb_date_range_inline/date_range_inline.rb
playbook_ui-7.0.0.pre.alpha6 app/pb_kits/playbook/pb_date_range_inline/date_range_inline.rb
playbook_ui-7.0.0.pre.alpha5 app/pb_kits/playbook/pb_date_range_inline/date_range_inline.rb
playbook_ui-6.4.0 app/pb_kits/playbook/pb_date_range_inline/date_range_inline.rb