Class: Decidim::Core::DateType

Inherits:
Api::Types::BaseScalar show all
Defined in:
decidim-core/lib/decidim/api/scalars/date_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_type.rb', line 8

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

.coerce_result(value, _ctx) ⇒ Object


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

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