Sha256: fcd1fb961510436399bcde370875dade1c01cd19ff80bbbfb4cf9b9270c61f65

Contents?: true

Size: 750 Bytes

Versions: 201

Compression:

Stored size: 750 Bytes

Contents

# frozen_string_literal: true

module Playbook
  module PbDateYearStacked
    class DateYearStacked
      include Playbook::Props

      partial "pb_date_year_stacked/date_year_stacked"

      prop :align, type: Playbook::Props::Enum,
                   values: %w[left center right],
                   default: "left"
      prop :dark, type: Playbook::Props::Boolean,
                  default: false
      prop :date

      def year
        as_date.to_year
      end

      def day_month
        "#{as_date.to_day.strip} #{as_date.to_month}"
      end

      def classname
        generate_classname("pb_date_year_stacked", align)
      end

    private

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

Version data entries

201 entries across 201 versions & 1 rubygems

Version Path
playbook_ui-7.14.0.pre.alpha1 app/pb_kits/playbook/pb_date_year_stacked/date_year_stacked.rb
playbook_ui-7.16.0 app/pb_kits/playbook/pb_date_year_stacked/date_year_stacked.rb
playbook_ui-7.15.1 app/pb_kits/playbook/pb_date_year_stacked/date_year_stacked.rb
playbook_ui-7.15.0 app/pb_kits/playbook/pb_date_year_stacked/date_year_stacked.rb
playbook_ui-7.14.0 app/pb_kits/playbook/pb_date_year_stacked/date_year_stacked.rb
playbook_ui-7.13.0.pre.alpha1 app/pb_kits/playbook/pb_date_year_stacked/date_year_stacked.rb
playbook_ui-7.13.0 app/pb_kits/playbook/pb_date_year_stacked/date_year_stacked.rb
playbook_ui-7.12.1 app/pb_kits/playbook/pb_date_year_stacked/date_year_stacked.rb
playbook_ui-7.12.0 app/pb_kits/playbook/pb_date_year_stacked/date_year_stacked.rb
playbook_ui-7.11.1 app/pb_kits/playbook/pb_date_year_stacked/date_year_stacked.rb
playbook_ui-7.11.0 app/pb_kits/playbook/pb_date_year_stacked/date_year_stacked.rb
playbook_ui-7.11.0.pre.alpha1 app/pb_kits/playbook/pb_date_year_stacked/date_year_stacked.rb
playbook_ui-7.10.0 app/pb_kits/playbook/pb_date_year_stacked/date_year_stacked.rb
playbook_ui-7.9.0 app/pb_kits/playbook/pb_date_year_stacked/date_year_stacked.rb
playbook_ui-7.8.4 app/pb_kits/playbook/pb_date_year_stacked/date_year_stacked.rb
playbook_ui-7.8.3 app/pb_kits/playbook/pb_date_year_stacked/date_year_stacked.rb
playbook_ui-7.8.2 app/pb_kits/playbook/pb_date_year_stacked/date_year_stacked.rb
playbook_ui-7.8.1 app/pb_kits/playbook/pb_date_year_stacked/date_year_stacked.rb
playbook_ui-7.8.0 app/pb_kits/playbook/pb_date_year_stacked/date_year_stacked.rb
playbook_ui-7.7.0.pre.alpha1 app/pb_kits/playbook/pb_date_year_stacked/date_year_stacked.rb