From c7a91cc0cd965eaad7f6327ab0a72c83cae6ee1b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Mateu=20Aguil=C3=B3=20Bosch?= <mateu.aguilo.bosch@gmail.com>
Date: Sun, 1 Apr 2018 07:41:30 +0200
Subject: [PATCH] Revert "Issue #2953227 by vtcore: Date Time enhancer does not
 work with Date range fields"

This reverts commit 5d80d634d3522380f153f51d984a42522ed11b97.
---
 .../DateTimeFromStringEnhancer.php            | 28 -------------------
 1 file changed, 28 deletions(-)

diff --git a/src/Plugin/jsonapi/FieldEnhancer/DateTimeFromStringEnhancer.php b/src/Plugin/jsonapi/FieldEnhancer/DateTimeFromStringEnhancer.php
index b5105ff..2378f79 100644
--- a/src/Plugin/jsonapi/FieldEnhancer/DateTimeFromStringEnhancer.php
+++ b/src/Plugin/jsonapi/FieldEnhancer/DateTimeFromStringEnhancer.php
@@ -19,20 +19,6 @@ class DateTimeFromStringEnhancer extends DateTimeEnhancerBase {
    * {@inheritdoc}
    */
   public function postProcess($value) {
-    if (is_array($value)) {
-        return array_map([$this, 'processSingleValue'], $value);
-    }
-
-    return $this->processSingleValue($value);
-  }
-
-  /**
-   * Process a single value
-   *
-   * @param $value
-   * @return string
-   */
-  protected function processSingleValue($value) {
     $storage_timezone = new \DateTimezone(DATETIME_STORAGE_TIMEZONE);
     $date = new \DateTime($value, $storage_timezone);
 
@@ -48,20 +34,6 @@ class DateTimeFromStringEnhancer extends DateTimeEnhancerBase {
    * {@inheritdoc}
    */
   public function prepareForInput($value) {
-    if (is_array($value)) {
-        return array_map([$this, 'prepareSingleValue'], $value);
-    }
-
-    return $this->prepareSingleValue($value);
-  }
-
-  /**
-   * Prepare a single value for input.
-   *
-   * @param $value
-   * @return string
-   */
-  protected function prepareSingleValue($value) {
     $date = new \DateTime($value);
 
     // Adjust the date for storage.
-- 
GitLab