fix add year
This commit is contained in:
1 parent
5cea2d4237
commit
a59efb6676
1 file changed
+2
-2
+2
-2
@@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in new issue
Block a user