Sha256: 7f98f015b703c115f85a81d4fd8cc970f9e2fd5d41709e3e5bdf0c3e0786300d

Contents?: true

Size: 1.16 KB

Versions: 703

Compression:

Stored size: 1.16 KB

Contents

# frozen_string_literal: true

module Playbook
  module PbDate
    class Date < Playbook::KitBase
      prop :date, required: true
      prop :alignment, type: Playbook::Props::Enum,
                       values: %w[left center right],
                       default: "left"
      prop :show_icon, type: Playbook::Props::Boolean,
                       default: false
      prop :show_day_of_week, type: Playbook::Props::Boolean,
                              default: false
      prop :size, type: Playbook::Props::Enum,
                  values: %w[lg md sm xs],
                  default: "md"
      prop :timezone, default: "America/New_York"
      prop :unstyled, type: Playbook::Props::Boolean,
                      default: false

      def classname
        generate_classname("pb_date_kit", alignment)
      end

      def day_of_week
        pb_date_time.to_day_of_week
      end

      def day
        pb_date_time.to_day
      end

      def month
        pb_date_time.to_month.capitalize
      end

      def year
        pb_date_time.to_year
      end

    private

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

Version data entries

703 entries across 703 versions & 1 rubygems

Version Path
playbook_ui-14.9.0.pre.rc.8 app/pb_kits/playbook/pb_date/date.rb
playbook_ui-14.8.0.pre.alpha.PLAY1598floatinguiupgrade4617 app/pb_kits/playbook/pb_date/date.rb
playbook_ui-14.9.0.pre.rc.7 app/pb_kits/playbook/pb_date/date.rb
playbook_ui-14.9.0.pre.rc.6 app/pb_kits/playbook/pb_date/date.rb
playbook_ui-14.9.0.pre.rc.5 app/pb_kits/playbook/pb_date/date.rb
playbook_ui-14.8.0.pre.alpha.pbntr661createstickyleftprop4612 app/pb_kits/playbook/pb_date/date.rb
playbook_ui-14.8.0.pre.alpha.play1648heightglobalprops4606 app/pb_kits/playbook/pb_date/date.rb
playbook_ui-14.9.0.pre.rc.4 app/pb_kits/playbook/pb_date/date.rb
playbook_ui-14.9.0.pre.rc.3 app/pb_kits/playbook/pb_date/date.rb
playbook_ui-14.9.0.pre.rc.2 app/pb_kits/playbook/pb_date/date.rb
playbook_ui-14.8.0.pre.alpha.revert3916revert3893PBNTR667railstypeaheadformintegration4567 app/pb_kits/playbook/pb_date/date.rb
playbook_ui-14.8.0.pre.alpha.revert3916revert3893PBNTR667railstypeaheadformintegration4565 app/pb_kits/playbook/pb_date/date.rb
playbook_ui-14.8.0.pre.alpha.PLAY1598floatinguiupgrade4563 app/pb_kits/playbook/pb_date/date.rb
playbook_ui-14.8.0.pre.alpha.play1648heightglobalprops4559 app/pb_kits/playbook/pb_date/date.rb
playbook_ui-14.9.0.pre.rc.1 app/pb_kits/playbook/pb_date/date.rb
playbook_ui-14.8.0.pre.alpha.PLAY16254545 app/pb_kits/playbook/pb_date/date.rb
playbook_ui-14.8.0.pre.alpha.PLAY1615movenegativetoleftofcurrencysign4543 app/pb_kits/playbook/pb_date/date.rb
playbook_ui-14.8.0.pre.alpha.PLAY1615movenegativetoleftofcurrencysign4539 app/pb_kits/playbook/pb_date/date.rb
playbook_ui-14.9.0.pre.rc.0 app/pb_kits/playbook/pb_date/date.rb
playbook_ui-14.7.0.pre.alpha.dependabotnpmandyarnfloatinguireact026284532 app/pb_kits/playbook/pb_date/date.rb