Sha256: 45e9d7a605706f73f6b318e6da48864bd95f06531b0505d944603b3984b8bae2

Contents?: true

Size: 775 Bytes

Versions: 1042

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

Version Path
playbook_ui-14.7.0.pre.alpha.dependabotnpmandyarnfloatinguireact026284532 app/pb_kits/playbook/pb_time_stacked/time_stacked.rb
playbook_ui-14.8.0 app/pb_kits/playbook/pb_time_stacked/time_stacked.rb
playbook_ui-14.7.0.pre.alpha.revert3916revert3893PBNTR667railstypeaheadformintegration4523 app/pb_kits/playbook/pb_time_stacked/time_stacked.rb
playbook_ui-14.8.0.pre.rc.8 app/pb_kits/playbook/pb_time_stacked/time_stacked.rb
playbook_ui-14.8.0.pre.rc.7 app/pb_kits/playbook/pb_time_stacked/time_stacked.rb
playbook_ui-14.8.0.pre.rc.6 app/pb_kits/playbook/pb_time_stacked/time_stacked.rb
playbook_ui-14.8.0.pre.rc.5 app/pb_kits/playbook/pb_time_stacked/time_stacked.rb
playbook_ui-14.8.0.pre.rc.4 app/pb_kits/playbook/pb_time_stacked/time_stacked.rb
playbook_ui-14.8.0.pre.rc.3 app/pb_kits/playbook/pb_time_stacked/time_stacked.rb
playbook_ui-14.7.0.pre.alpha.PBNTR637quickpickdefaultdate4492 app/pb_kits/playbook/pb_time_stacked/time_stacked.rb
playbook_ui-14.8.0.pre.rc.2 app/pb_kits/playbook/pb_time_stacked/time_stacked.rb
playbook_ui-14.7.0.pre.alpha.spacingquickchange4482 app/pb_kits/playbook/pb_time_stacked/time_stacked.rb
playbook_ui-14.7.0.pre.alpha.PBNTR637quickpickdefaultdate4478 app/pb_kits/playbook/pb_time_stacked/time_stacked.rb
playbook_ui-14.7.0.pre.alpha.PBNTR667railstypeaheadformintegration4454 app/pb_kits/playbook/pb_time_stacked/time_stacked.rb
playbook_ui-14.8.0.pre.rc.1 app/pb_kits/playbook/pb_time_stacked/time_stacked.rb
playbook_ui-14.7.0.pre.alpha.dependabotnpmandyarnintltelinput24704448 app/pb_kits/playbook/pb_time_stacked/time_stacked.rb
playbook_ui-14.8.0.pre.rc.0 app/pb_kits/playbook/pb_time_stacked/time_stacked.rb
playbook_ui-14.7.0 app/pb_kits/playbook/pb_time_stacked/time_stacked.rb
playbook_ui-14.6.2.pre.alpha.PLAY1613darkdatetimecolors4432 app/pb_kits/playbook/pb_time_stacked/time_stacked.rb
playbook_ui-14.7.0.pre.rc.19 app/pb_kits/playbook/pb_time_stacked/time_stacked.rb