Sha256: c4848ecf085f10d436e229972b56f76a2ba998b28df5fb0f71bdfb4b6a32b573

Contents?: true

Size: 320 Bytes

Versions: 12

Compression:

Stored size: 320 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Core
    DateTimeType = GraphQL::ScalarType.define do
      name "DateTime"
      description "An ISO8601 date with time"
      coerce_input ->(value, _ctx) { Time.iso8601(value) }
      coerce_result ->(value, _ctx) { value.to_datetime.iso8601 }
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
decidim-core-0.13.1 app/types/decidim/core/date_time_type.rb
decidim-core-0.12.2 app/types/decidim/core/date_time_type.rb
decidim-core-0.13.0 app/types/decidim/core/date_time_type.rb
decidim-core-0.12.1 app/types/decidim/core/date_time_type.rb
decidim-core-0.13.0.pre1 app/types/decidim/core/date_time_type.rb
decidim-core-0.12.0 app/types/decidim/core/date_time_type.rb
decidim-core-0.11.2 app/types/decidim/core/date_time_type.rb
decidim-core-0.12.0.pre app/types/decidim/core/date_time_type.rb
decidim-core-0.11.1 app/types/decidim/core/date_time_type.rb
decidim-core-0.11.0.pre1 app/types/decidim/core/date_time_type.rb
decidim-core-0.10.1 app/types/decidim/core/date_time_type.rb
decidim-core-0.10.0 app/types/decidim/core/date_time_type.rb