Added datetime functionality

This commit is contained in:
Dennis Eichhorn 2016-09-14 18:06:05 +02:00
parent bc217f5490
commit 80a659d21a

View File

@ -116,6 +116,16 @@ class SmartDateTime extends \DateTime
return $this;
}
public function getEndOfMonth() : SmartDateTime
{
return new SmartDateTime($this->format('Y') . '-' . $this->format('m') . '-' . $this->getDaysOfMonth());
}
public function getStartOfMonth() : SmartDateTime
{
return new SmartDateTime($this->format('Y') . '-' . $this->format('m') . '-01');
}
/**
* Get days of current month
*