Sha256: 5a427be21240721db32b649b8fffb2524313bcf5e8b5ccdccc97fdcdd9fbad19

Contents?: true

Size: 688 Bytes

Versions: 36

Compression:

Stored size: 688 Bytes

Contents

module Avo
  module Fields
    class DateField < TextField
      attr_reader :first_day_of_week
      attr_reader :picker_format
      attr_reader :disable_mobile
      attr_reader :format

      def initialize(id, **args, &block)
        super(id, **args, &block)

        add_string_prop args, :first_day_of_week, 1
        add_string_prop args, :picker_format, "Y-m-d"
        add_string_prop args, :format, "yyyy-LL-dd"
        add_boolean_prop args, :disable_mobile
      end

      def formatted_value
        return if value.blank?

        value.iso8601
      end

      def edit_formatted_value
        return nil if value.nil?

        value.iso8601
      end
    end
  end
end

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
avo-2.17.1.pre.2.customauthorizationclients lib/avo/fields/date_field.rb
avo-2.17.1.pre.1.zeitwerk.eager.load.dir lib/avo/fields/date_field.rb
avo-2.17.0 lib/avo/fields/date_field.rb
avo-2.16.1.pre.1.nativefields lib/avo/fields/date_field.rb
avo-2.16.0 lib/avo/fields/date_field.rb
avo-2.15.3 lib/avo/fields/date_field.rb
avo-2.15.3.pre.1.data.attrs.to.sidebar.items lib/avo/fields/date_field.rb
avo-2.15.2 lib/avo/fields/date_field.rb
avo-2.15.2.pre.1 lib/avo/fields/date_field.rb
avo-2.15.1 lib/avo/fields/date_field.rb
avo-2.15.0 lib/avo/fields/date_field.rb
avo-2.14.3.pre.7.polytranslations1 lib/avo/fields/date_field.rb
avo-2.14.3.pre.6.nosprockets lib/avo/fields/date_field.rb
avo-2.14.3.pre.5.nosprockets lib/avo/fields/date_field.rb
avo-2.14.3.pre.4.tosqlfix lib/avo/fields/date_field.rb
avo-2.14.3.pre.3.jsbundling lib/avo/fields/date_field.rb
avo-2.14.3.pre.2.tailwindcss lib/avo/fields/date_field.rb
avo-2.14.3.pre.1.branding lib/avo/fields/date_field.rb
avo-2.14.2 lib/avo/fields/date_field.rb
avo-2.14.2.pre.1 lib/avo/fields/date_field.rb