Sha256: e5c54c70b42b92b13da6f04d809c8124e28dc59a191cfe73dc1df6a815628920

Contents?: true

Size: 1.07 KB

Versions: 350

Compression:

Stored size: 1.07 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"

      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

350 entries across 350 versions & 1 rubygems

Version Path
playbook_ui-12.22.0.pre.alpha.play698responsivespacingglobalprop690 app/pb_kits/playbook/pb_date/date.rb
playbook_ui-12.22.0.pre.alpha.PBNTR12checkingemptyfilters686 app/pb_kits/playbook/pb_date/date.rb
playbook_ui-12.22.0 app/pb_kits/playbook/pb_date/date.rb
playbook_ui-12.21.0.pre.alpha.PLAY807RTEcustomtoolbar680 app/pb_kits/playbook/pb_date/date.rb
playbook_ui-12.21.0 app/pb_kits/playbook/pb_date/date.rb
playbook_ui-12.20.0.pre.alpha.movemarkdown668 app/pb_kits/playbook/pb_date/date.rb
playbook_ui-12.20.0.pre.alpha.title2667 app/pb_kits/playbook/pb_date/date.rb
playbook_ui-12.20.0.pre.alpha.title2665 app/pb_kits/playbook/pb_date/date.rb
playbook_ui-12.20.0 app/pb_kits/playbook/pb_date/date.rb
playbook_ui-12.19.0.pre.alpha.PLAY699zindexresponsive650 app/pb_kits/playbook/pb_date/date.rb
playbook_ui-12.19.0.pre.alpha.movemarkdown639 app/pb_kits/playbook/pb_date/date.rb
playbook_ui-12.19.0.pre.alpha.PLAY603datepickerquickpickinputpresetdropdown638 app/pb_kits/playbook/pb_date/date.rb
playbook_ui-12.19.0.pre.alpha.movemarkdown637 app/pb_kits/playbook/pb_date/date.rb
playbook_ui-12.18.0.pre.alpha.PLAY785typeaheadts632 app/pb_kits/playbook/pb_date/date.rb
playbook_ui-12.19.0 app/pb_kits/playbook/pb_date/date.rb
playbook_ui-12.18.0.pre.alpha.PLAY603datepickerquickpickinputpresetdropdown629 app/pb_kits/playbook/pb_date/date.rb
playbook_ui-12.18.0.pre.alpha.PLAY603datepickerquickpickinputpresetdropdown628 app/pb_kits/playbook/pb_date/date.rb
playbook_ui-12.18.0.pre.alpha.play786multilevelselectimprovements627 app/pb_kits/playbook/pb_date/date.rb
playbook_ui-12.18.0.pre.alpha.PLAY603datepickerquickpickinputpresetdropdown626 app/pb_kits/playbook/pb_date/date.rb
playbook_ui-12.18.0.pre.alpha.PLAY603datepickerquickpickinputpresetdropdown617 app/pb_kits/playbook/pb_date/date.rb