fix add year

This commit is contained in:
Nasser committed 2020-08-21 15:37:21 +04:30
1 parent 5cea2d4237
commit a59efb6676
1 file changed
+2 -2
+2 -2
View File
@@ -2161,7 +2161,7 @@ class Verta extends DateTime {
*/ */
public function addYears($value) 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) public function subYears($value)
{ {
return $this->addYears(-1 * $value)->modify('-1 day'); return $this->addYears(-1 * $value);
} }
/** /**