From 463d9bdd2a60e03342f4b1a6f69fc09a58744d65 Mon Sep 17 00:00:00 2001
From: Natallia Kazarynava <nkazaryn@its.jnj.com>
Date: Sun, 20 Mar 2022 08:06:52 +0000
Subject: [PATCH] AGGB-3755: [date] Multiple PHP warnings

---
 date_api/date_api.module  | 2 +-
 date_api/date_api_sql.inc | 4 +++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/date_api/date_api.module b/date_api/date_api.module
index 96750178f2..29ccb17649 100644
--- a/date_api/date_api.module
+++ b/date_api/date_api.module
@@ -312,7 +312,7 @@ class DateObject extends DateTime {
    * @return object
    *   A merged date object.
    */
-  public function merge(FeedsDateTime $other) {
+  public function merge(DateObject $other) {
     $other_tz = $other->getTimezone();
     $this_tz = $this->getTimezone();
     // Figure out which timezone to use for combination.
diff --git a/date_api/date_api_sql.inc b/date_api/date_api_sql.inc
index a95ca4efa9..a569d770aa 100644
--- a/date_api/date_api_sql.inc
+++ b/date_api/date_api_sql.inc
@@ -887,9 +887,11 @@ class date_sql_handler {
     if ($value <= 0) {
       return FALSE;
     }
+
+    $date_min_year = variable_get('date_min_year', 1);
     switch ($type) {
       case 'year':
-        if ($value < DATE_MIN_YEAR) {
+        if ($value < $date_min_year) {
           return FALSE;
         }
         break;
-- 
2.35.1

