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.3.0.pre.alpha2 app/pb_kits/playbook/pb_date_range_inline/date_range_inline.rb
playbook_ui-7.0.1 app/pb_kits/playbook/pb_date_range_inline/date_range_inline.rb
playbook_ui-6.8.2.pre.alpha1 app/pb_kits/playbook/pb_date_range_inline/date_range_inline.rb
playbook_ui-7.0.0.pre.alpha15 app/pb_kits/playbook/pb_date_range_inline/date_range_inline.rb
playbook_ui-7.0.1.pre.alpha14 app/pb_kits/playbook/pb_date_range_inline/date_range_inline.rb
playbook_ui-7.0.0.pre.alpha14 app/pb_kits/playbook/pb_date_range_inline/date_range_inline.rb
playbook_ui-7.0.0.pre.alpha13 app/pb_kits/playbook/pb_date_range_inline/date_range_inline.rb
playbook_ui-7.0.0.pre.alpha12 app/pb_kits/playbook/pb_date_range_inline/date_range_inline.rb
playbook_ui-7.0.0 app/pb_kits/playbook/pb_date_range_inline/date_range_inline.rb
playbook_ui-7.0.0.pre.alpha11 app/pb_kits/playbook/pb_date_range_inline/date_range_inline.rb
playbook_ui-6.8.1 app/pb_kits/playbook/pb_date_range_inline/date_range_inline.rb
playbook_ui-6.8.0 app/pb_kits/playbook/pb_date_range_inline/date_range_inline.rb
playbook_ui-6.7.0.pre.alpha1 app/pb_kits/playbook/pb_date_range_inline/date_range_inline.rb
playbook_ui-6.7.0 app/pb_kits/playbook/pb_date_range_inline/date_range_inline.rb
playbook_ui-6.6.1 app/pb_kits/playbook/pb_date_range_inline/date_range_inline.rb
playbook_ui-7.0.0.pre.alpha10 app/pb_kits/playbook/pb_date_range_inline/date_range_inline.rb
playbook_ui-6.6.0 app/pb_kits/playbook/pb_date_range_inline/date_range_inline.rb
playbook_ui-6.5.2 app/pb_kits/playbook/pb_date_range_inline/date_range_inline.rb
playbook_ui-7.0.1.pre.alpha12 app/pb_kits/playbook/pb_date_range_inline/date_range_inline.rb
playbook_ui-7.0.1.pre.alpha11 app/pb_kits/playbook/pb_date_range_inline/date_range_inline.rb