Sha256: ca862e2a98d850b4de014147148d6bea78081d84c861e7e3302f78ee9bc9fc36

Contents?: true

Size: 950 Bytes

Versions: 114

Compression:

Stored size: 950 Bytes

Contents

# frozen_string_literal: true

module Playbook
  module PbDate
    class Date
      include ActionView::Helpers::TagHelper
      include ActionView::Context
      include Playbook::Props

      partial "pb_date/date"

      prop :date, required: true
      prop :size, type: Playbook::Props::Enum,
                  values: %w[lg sm xs],
                  default: "sm"

      def classname
        generate_classname("pb_date_kit")
      end

      def xs_date
        "#{pb_date_time.to_day_of_week.upcase} · #{pb_date_time.to_month.upcase} #{pb_date_time.to_day}".html_safe
      end

      def lg_date
        "#{pb_date_time.to_month.upcase} #{pb_date_time.to_day}"
      end

      def sm_date
        "#{pb_date_time.to_day_of_week.upcase} · #{pb_date_time.to_month.upcase} #{pb_date_time.to_day}".html_safe
      end

    private

      def pb_date_time
        Playbook::PbKit::PbDateTime.new(date)
      end
    end
  end
end

Version data entries

114 entries across 114 versions & 1 rubygems

Version Path
playbook_ui-5.0.3 app/pb_kits/playbook/pb_date/date.rb
playbook_ui-5.0.2 app/pb_kits/playbook/pb_date/date.rb
playbook_ui-5.0.1.pre.beta app/pb_kits/playbook/pb_date/date.rb
playbook_ui-5.1.0.pre.alpha4 app/pb_kits/playbook/pb_date/date.rb
playbook_ui-5.1.0.pre.alpha2 app/pb_kits/playbook/pb_date/date.rb
playbook_ui-5.1.0.pre.alpha1 app/pb_kits/playbook/pb_date/date.rb
playbook_ui-5.0.1 app/pb_kits/playbook/pb_date/date.rb
playbook_ui-5.0.1.pre.alpha1 app/pb_kits/playbook/pb_date/date.rb
playbook_ui-4.18.1.pre.alpha1 app/pb_kits/playbook/pb_date/date.rb
playbook_ui-4.18.1 app/pb_kits/playbook/pb_date/date.rb
playbook_ui-4.18.0 app/pb_kits/playbook/pb_date/date.rb
playbook_ui-4.17.0 app/pb_kits/playbook/pb_date/date.rb
playbook_ui-4.17.0.pre.alpha1 app/pb_kits/playbook/pb_date/date.rb
playbook_ui-4.16.0 app/pb_kits/playbook/pb_date/date.rb
playbook_ui-4.15.0 app/pb_kits/playbook/pb_date/date.rb
playbook_ui-4.14.0 app/pb_kits/playbook/pb_date/date.rb
playbook_ui-4.15.1.alpha1 app/pb_kits/playbook/pb_date/date.rb
playbook_ui-4.13.1 app/pb_kits/playbook/pb_date/date.rb
playbook_ui-4.13.0 app/pb_kits/playbook/pb_date/date.rb
playbook_ui-4.12.0 app/pb_kits/playbook/pb_date/date.rb