Class: Decidim::Core::DateTimeType

Inherits:
Api::Types::BaseScalar show all
Defined in:
decidim-core/lib/decidim/api/scalars/date_time_type.rb

Class Method Summary collapse

Class Method Details

.coerce_input(value, _ctx) ⇒ Object


8
9
10
# File 'decidim-core/lib/decidim/api/scalars/date_time_type.rb', line 8

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

.coerce_result(value, _ctx) ⇒ Object


12
13
14
# File 'decidim-core/lib/decidim/api/scalars/date_time_type.rb', line 12

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