Sha256: d6a32dd597ceecde856e11d4a5e9bd7f02caeb5108a33bdc4f808cddc8c37bf6

Contents?: true

Size: 344 Bytes

Versions: 50

Compression:

Stored size: 344 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Core
    class DateTimeType < Decidim::Api::Types::BaseScalar
      description "An ISO8601 date with time"

      def self.coerce_input(value, _ctx)
        Time.iso8601(value)
      end

      def self.coerce_result(value, _ctx)
        value.to_time.iso8601
      end
    end
  end
end

Version data entries

50 entries across 50 versions & 1 rubygems

Version Path
decidim-core-0.25.0.rc4 lib/decidim/api/scalars/date_time_type.rb
decidim-core-0.25.0.rc3 lib/decidim/api/scalars/date_time_type.rb
decidim-core-0.25.0.rc2 lib/decidim/api/scalars/date_time_type.rb
decidim-core-0.25.0.rc1 lib/decidim/api/scalars/date_time_type.rb
decidim-core-0.24.3 lib/decidim/api/scalars/date_time_type.rb
decidim-core-0.24.2 lib/decidim/api/scalars/date_time_type.rb
decidim-core-0.24.1 lib/decidim/api/scalars/date_time_type.rb
decidim-core-0.24.0 lib/decidim/api/scalars/date_time_type.rb
decidim-core-0.24.0.rc2 lib/decidim/api/scalars/date_time_type.rb
decidim-core-0.24.0.rc1 lib/decidim/api/scalars/date_time_type.rb