Sha256: 45e9d7a605706f73f6b318e6da48864bd95f06531b0505d944603b3984b8bae2

Contents?: true

Size: 775 Bytes

Versions: 1182

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,182 entries across 1,182 versions & 1 rubygems

Version Path
playbook_ui-8.3.0 app/pb_kits/playbook/pb_time_stacked/time_stacked.rb
playbook_ui-8.2.1.pre.alpha5 app/pb_kits/playbook/pb_time_stacked/time_stacked.rb
playbook_ui-8.2.1.pre.alpha4 app/pb_kits/playbook/pb_time_stacked/time_stacked.rb
playbook_ui-8.2.1.alpha.iconacc app/pb_kits/playbook/pb_time_stacked/time_stacked.rb
playbook_ui-8.2.1.pre.alpha3 app/pb_kits/playbook/pb_time_stacked/time_stacked.rb
playbook_ui-8.2.1.pre.alpha2 app/pb_kits/playbook/pb_time_stacked/time_stacked.rb
playbook_ui-8.3.0.deps2 app/pb_kits/playbook/pb_time_stacked/time_stacked.rb
playbook_ui-8.3.0.pre.alpha1 app/pb_kits/playbook/pb_time_stacked/time_stacked.rb
playbook_ui-8.2.1.pre.alpha1 app/pb_kits/playbook/pb_time_stacked/time_stacked.rb
playbook_ui-8.2.1 app/pb_kits/playbook/pb_time_stacked/time_stacked.rb
playbook_ui-8.1.3 app/pb_kits/playbook/pb_time_stacked/time_stacked.rb
playbook_ui-8.4.0.alpha.dependencies.2 app/pb_kits/playbook/pb_time_stacked/time_stacked.rb
playbook_ui-8.4.0.alpha.dependencies.1 app/pb_kits/playbook/pb_time_stacked/time_stacked.rb
playbook_ui-8.2.0.pre.alpha4 app/pb_kits/playbook/pb_time_stacked/time_stacked.rb
playbook_ui-8.2.0.pre.alpha3 app/pb_kits/playbook/pb_time_stacked/time_stacked.rb
playbook_ui-8.2.0 app/pb_kits/playbook/pb_time_stacked/time_stacked.rb
playbook_ui-8.1.2 app/pb_kits/playbook/pb_time_stacked/time_stacked.rb
playbook_ui-8.1.0.pre.alpha1 app/pb_kits/playbook/pb_time_stacked/time_stacked.rb
playbook_ui-8.2.0.pre.alpha2 app/pb_kits/playbook/pb_time_stacked/time_stacked.rb
playbook_ui-8.1.1 app/pb_kits/playbook/pb_time_stacked/time_stacked.rb