From a59efb6676ef1d3a5c4ce6bcc062c60edd9e4862 Mon Sep 17 00:00:00 2001 From: Nasser Date: Fri, 21 Aug 2020 15:37:21 +0430 Subject: [PATCH] fix add year --- src/Verta.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Verta.php b/src/Verta.php index a85b223..232eb6a 100755 --- a/src/Verta.php +++ b/src/Verta.php @@ -2161,7 +2161,7 @@ class Verta extends DateTime { */ public function addYears($value) { - return $this->modify((int) $value.' year'); + return $this->year($this->year + $value); } /** @@ -2185,7 +2185,7 @@ class Verta extends DateTime { */ public function subYears($value) { - return $this->addYears(-1 * $value)->modify('-1 day'); + return $this->addYears(-1 * $value); } /**