Sha256: 45e9d7a605706f73f6b318e6da48864bd95f06531b0505d944603b3984b8bae2

Contents?: true

Size: 775 Bytes

Versions: 1045

Compression:

Stored size: 775 Bytes

Contents

# frozen_string_literal: true

module Playbook
  module PbTimeStacked
    class TimeStacked < Playbook::KitBase
      prop :time, required: true
      prop :align, type: Playbook::Props::Enum,
                   values: %w[left center right],
                   default: "left"
      prop :timezone, default: "America/New_York"

      def classname
        # convert deprecated prop values
        generate_classname("pb_time_stacked_kit", align)
      end

      def format_time_string
        "#{pb_date_time.to_hour}:#{pb_date_time.to_minutes}#{pb_date_time.to_meridian}"
      end

      def format_timezone_string
        pb_date_time.to_timezone.to_s
      end

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

Version data entries

1,045 entries across 1,045 versions & 1 rubygems

Version Path
playbook_ui-14.9.0.pre.rc.9 app/pb_kits/playbook/pb_time_stacked/time_stacked.rb
playbook_ui-14.8.0.pre.alpha.PLAY1680newwidthprop4661 app/pb_kits/playbook/pb_time_stacked/time_stacked.rb
playbook_ui-14.8.0.pre.alpha.PLAY1658tanstackbump4657 app/pb_kits/playbook/pb_time_stacked/time_stacked.rb
playbook_ui-14.8.0.pre.alpha.PLAY1649rolloutheightglobalprops4635 app/pb_kits/playbook/pb_time_stacked/time_stacked.rb
playbook_ui-14.9.0.pre.rc.8 app/pb_kits/playbook/pb_time_stacked/time_stacked.rb
playbook_ui-14.8.0.pre.alpha.PLAY1598floatinguiupgrade4617 app/pb_kits/playbook/pb_time_stacked/time_stacked.rb
playbook_ui-14.9.0.pre.rc.7 app/pb_kits/playbook/pb_time_stacked/time_stacked.rb
playbook_ui-14.9.0.pre.rc.6 app/pb_kits/playbook/pb_time_stacked/time_stacked.rb
playbook_ui-14.9.0.pre.rc.5 app/pb_kits/playbook/pb_time_stacked/time_stacked.rb
playbook_ui-14.8.0.pre.alpha.pbntr661createstickyleftprop4612 app/pb_kits/playbook/pb_time_stacked/time_stacked.rb
playbook_ui-14.8.0.pre.alpha.play1648heightglobalprops4606 app/pb_kits/playbook/pb_time_stacked/time_stacked.rb
playbook_ui-14.9.0.pre.rc.4 app/pb_kits/playbook/pb_time_stacked/time_stacked.rb
playbook_ui-14.9.0.pre.rc.3 app/pb_kits/playbook/pb_time_stacked/time_stacked.rb
playbook_ui-14.9.0.pre.rc.2 app/pb_kits/playbook/pb_time_stacked/time_stacked.rb
playbook_ui-14.8.0.pre.alpha.revert3916revert3893PBNTR667railstypeaheadformintegration4567 app/pb_kits/playbook/pb_time_stacked/time_stacked.rb
playbook_ui-14.8.0.pre.alpha.revert3916revert3893PBNTR667railstypeaheadformintegration4565 app/pb_kits/playbook/pb_time_stacked/time_stacked.rb
playbook_ui-14.8.0.pre.alpha.PLAY1598floatinguiupgrade4563 app/pb_kits/playbook/pb_time_stacked/time_stacked.rb
playbook_ui-14.8.0.pre.alpha.play1648heightglobalprops4559 app/pb_kits/playbook/pb_time_stacked/time_stacked.rb
playbook_ui-14.9.0.pre.rc.1 app/pb_kits/playbook/pb_time_stacked/time_stacked.rb
playbook_ui-14.8.0.pre.alpha.PLAY16254545 app/pb_kits/playbook/pb_time_stacked/time_stacked.rb